Programming Fundamental 4 Lec
Programming Fundamental 4 Lec
Fundamental
s
Week 2 Day 1
Assignments
String data type statement and
what it does?
Previously
• The program that you write should be clear not only to you, but
also to the reader of your program.
• Part of good programming is the inclusion of comments in the
program.
Comments
Comments
• Which data type you use, depends on how big a number your
program needs to deal with.
Integral Data Types
int Data Type
• The data type bool has only two values: true and false.
• Also, true and false are called the logical (Boolean) values.
• In C++, bool, true, and false are reserved words.
char Data Type
• What is operand?
• What is operator?
• Unary operand
• Binary Operator
• Arithmetic expressions.
Operator Precedence
• If the operator has the same types of operands (that is, either
both integers or both floating-point numbers), the operator is
evaluated according to the type of operands.
• Integer operands thus yield an integer result; floating-point
numbers yield a floating-point number.
Apply when evaluating a mixed
expression
• Declaration statements:
• Declaration statements are used to declare things, such as variables.
• Executable statements
• Executable statements perform calculations, manipulate data, create
output, accept input, and so on.
Declaration Statements
Executable statements
Debugging: Understanding and Fixing
Syntax Errors
Debugging: Understanding and Fixing
Syntax Errors