Chapter 1-C++
Chapter 1-C++
Chapter 1-C++
Introduction to Programming
Introduction
What is a computer?
A Computer is an electronic device that accepts data,
performs computations, and makes logical decisions
according to instructions that have been given to it;
then produces meaningful information in a form that is
useful to the user.
1. Start
2. Initialize Sum to 0 and Counter to 1
2.1 If the Counter is less than or equal to 50
• Add Counter to Sum
• Increase Counter by 1
• Repeat step 2.1
2.2 Else
• Exit Loop
3. Write Sum
4. Stop
Exercise:
1. Write an algorithm description and draw a flow chart to
check a number is even or odd.