Download presentation
Presentation is loading. Please wait.
1
310201 Fundamental Programming
Final Review
2
The place of programming
The software development life cycle Analysis of problem Specification Design of algorithm Coding of program Testing and Debugging Documentation Maintenance
3
The five types of statement
Input Output Assignment Selection Repetition
4
Selection If … Else … Switch
5
if-else statement if ((Age < 18) && (Sex=‘M’)) {
cout << “A male child“ << endl; } else cout << “A male adult“ << endl;
6
Switch statement switch ( CharMenuSelection ) { case 'a': case 'A':
ProcessSelectionA; break; case 'b': case 'B': ProcessSelectionB; default: ProcessOther; }
7
Repetition While loops Do … While loops For loops
8
While loop Sum = 0 ; Number = 5; while (Number > 0) {
} cout << “The sum is “ << Sum << endl;
9
do-while loops if a task must be performed at least once, we can perform the test at the end of the loop using do-while do { cout << “Select a number between 1 and 5“; cin >> Num; } while ((Num<1) || (Num>5));
10
For loops for ( int Counter = 0; Counter < 5; Counter++ ) {
cout << “Counter = “ << Counter << endl; }
11
Operators Arithmetic +, -, *, /, %
Relational ==, !=, >, >=, <, <= Logical &&, ||, !
12
Variable Types Integer – int, long Floating point – float, double
Character – char Boolean - bool
13
Modularization (1) Functions Library functions Function headers
Prototypes Calling functions
14
Modularization (2) Global Variables Local Variables
Parameters and Arguments Passing by Reference Passing by Value Return Values
15
Arrays Declaring Arrays Using Arrays Passing Arrays to Functions
Strings Multidimensional Arrays
16
Summary We’ve finished!
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.