Introduction to Basic Computer Programming
Presentation Outline:
1. What is Programming?
2. Why Learn Programming?
3. Fundamental Concepts:
o Variables
o Data Types
o Operators
o Control Flow (Conditional Statements & Loops)
o Functions
4. Programming Languages (Brief Overview):
o Python
o JavaScript
o Java
o C++
5. The Programming Process:
o Problem Analysis
o Algorithm Design
o Coding
o Testing & Debugging
6. Getting Started:
o Choosing a Language
o Setting up a Development Environment
o Resources for Learning
7. Assessment (Quiz & Practical Exercise)
1. What is Programming?
Programming is the process of creating instructions that tell a computer what
to do.
These instructions are written in a specific language that the computer can
understand.
Think of it as giving a computer a detailed recipe to follow.
2. Why Learn Programming?
Problem Solving: Develops critical thinking and logical reasoning.
Automation: Automate repetitive tasks.
Creativity: Build your own applications, games, and websites.
Career Opportunities: High demand for programmers in various industries.
Understanding Technology: Gain a deeper understanding of how computers
work.
3. Fundamental Concepts:
Variables:
o Containers for storing data.
o Example: age = 25, name = "Alice"
Data Types:
o Different types of data that a variable can hold.
o Examples:
Integer (e.g., 10, -5)
Float (e.g., 3.14, 2.5)
String (e.g., "Hello", "World")
Boolean (e.g., True, False)
Operators:
o Symbols that perform operations on data.
o Examples:
Arithmetic operators (+, -, *, /)
Comparison operators (==, !=, >, <)
Logical operators (and, or, not)
Control Flow:
o Determines the order in which instructions are executed.
o Conditional Statements (if, else, elif):
Execute different blocks of code based on conditions.
Example:
Python
if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
o Loops (for, while):
Repeat a block of code multiple times.
Example:
Python
for i in range(5):
print(i)
Functions:
o Reusable blocks of code that perform specific tasks.
o Helps to organize and modularize code.
o Example:
Python
def greet(name):
print("Hello, " + name + "!")
greet("Bob")
4. Programming Languages (Brief Overview):
Python:
o Beginner-friendly, versatile, used for web development, data science,
and more.
JavaScript:
o Essential for front-end web development, also used for back-end
(Node.js).
Java:
o Object-oriented, widely used for enterprise applications and Android
development.
C++:
o Powerful, used for system programming, game development, and high-
performance applications.
5. The Programming Process:
Problem Analysis: Understand the problem you are trying to solve.
Algorithm Design: Create a step-by-step plan (algorithm) to solve the
problem.
Coding: Write the code in a programming language.
Testing & Debugging: Test the code to find and fix errors (bugs).
6. Getting Started:
Choose a Language: Start with Python for its simplicity.
Set up a Development Environment:
o Install a text editor or IDE (Integrated Development Environment) like
VS Code, PyCharm, or IDLE.
o Install the appropriate interpreter for the chosen language.
Resources for Learning:
o Online tutorials (e.g., Codecademy, Coursera, Khan Academy)
o Books and documentation
o Online communities (e.g., Stack Overflow, Reddit)
7. Assessment:
A. Quiz (Multiple Choice):
1. What is a variable?
o a) A type of data
o b) A container for storing data
o c) An operator
o d) A loop.
2. Which of the following is a data type?
o a) if
o b) for
o c) string
o d) function
3. What is the purpose of a loop?
o a) To store data
o b) To repeat a block of code
o c) To perform arithmetic operations
o d) To define a function
4. What is debugging?
o a) Writing Code.
o b) Designing Algorithms.
o c) Finding and fixing errors.
o d) Problem analysis.
5. Which language is known for being beginner friendly?
o a) C++
o b) Java
o c) Python
o d) Javascript
Answer Key:
1. b
2. c
3. b
4. c
5. c
B. Practical Exercise:
1. Write a Python program that:
o Asks the user for their name and age.
o Prints a greeting message with their name.
o Prints a message indicating whether they are an adult or a minor.
Example output:
Enter your name: John
Enter your age: 20
Hello, John!
You are an adult.
2. Write a python program that:
o Prints the numbers 1 to 10 using a for loop.
o Prints only the even numbers.
Example solution for problem 1:
Python
name = input("Enter your name: ")
age = int(input("Enter your age: "))
print("Hello, " + name + "!")
if age >= 18:
print("You are an adult.")
else:
print("You are a minor.")
Example Solution for problem 2:
Python
for i in range(1, 11):
print(i)
for i in range(2, 11, 2):
print(i)
This presentation provides a basic introduction to computer programming, covering
essential concepts and practical exercises to reinforce learning.