0% found this document useful (0 votes)
9 views2 pages

1 Introduction To Programming

Chapter 1 introduces programming as the act of writing instructions for computers using languages like Python and Java. It highlights the importance of programming in problem-solving and automation across various fields, along with basic terminology such as variables, functions, and loops. The chapter includes examples, practice exercises, and review questions to reinforce learning.

Uploaded by

Injust Kai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

1 Introduction To Programming

Chapter 1 introduces programming as the act of writing instructions for computers using languages like Python and Java. It highlights the importance of programming in problem-solving and automation across various fields, along with basic terminology such as variables, functions, and loops. The chapter includes examples, practice exercises, and review questions to reinforce learning.

Uploaded by

Injust Kai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 1: Introduction to Programming

In this chapter, you will learn what programming is, why it matters, and how to write your very
first program. Programming is the foundation of computer science and problem-solving with
technology.

What is Programming?
Programming is the act of writing instructions for a computer to follow. These instructions are
written in programming languages such as Python, Java, or C++. A program tells the
computer what tasks to perform and in what order.

Why Learn Programming?


• It helps you solve problems step-by-step.
• It gives you the power to automate tasks.
• It is used in almost every field: science, business, art, and more.

Basic Terminology
• Variable: A container that stores data (like a box with a label).
• Function: A reusable set of instructions that performs a task.
• Loop: A way to repeat instructions multiple times.
• Syntax: The grammar rules of a programming language.

First Program Example


In Python, the simplest program is:

print('Hello, World!')

This command tells the computer to display the phrase 'Hello, World!' on the screen.

Practice Exercises
• Write a program that prints your name and your favorite hobby.
• Write a program that displays your age on the screen.

Homework & Mini Projects


• Write a program that prints three different sentences on three different lines.
• Write a program that prints a short poem or song lyrics of your choice.

Chapter Review Questions


• True/False: A function is a reusable block of code. (Answer: True)
• Multiple Choice: Which of these is NOT a programming language? (a) Python (b) Java (c)
Banana (Answer: c)
• Short Answer: What does the command print('Hello, World!') do?

You might also like