Week 1 Introduction To Programming v2
Week 1 Introduction To Programming v2
• Programming Language
a language used to write programs
– Key Words
– Programmer-Defined Identifiers
– Operators
– Punctuation
– Syntax
int main()
{
double num1 = 5,
num2, sum;
num2 = 12.5;
• A flowchart is a diagram
many hours did you
work?”
program.
• The figure shown here is a
Display message “How
much do you get paid per
hour?”
END
rectangles hour?”
– indicate a starting or
ending point Read Pay Rate
Terminal
END
– represented by
parallelograms Display message “How
much do you get paid per
hour?” Input/Output
operation
Read Pay Rate
END
• Processes work?”
END
Flowchart work?”
Read Hours
Your gross pay is
800
Variable Contents:
Hours: 40
Pay Rate: 20 Output Operation Display Gross Pay
Gross Pay: 800
END
NO YES
YES
x < y? Process A
1 2 3 Other
as a function in C++) is
represented by a special Read Input.
symbol.
Call calc_pay
function.
Display results.
END
int main()
{
cout << "Programming is great fun!";
• Example:
#include <iostream>