1 / 16

310201 Fundamental Programming

310201 Fundamental Programming. Final Review. The place of programming. The software development life cycle Analysis of problem Specification Design of algorithm Coding of program Testing and Debugging Documentation Maintenance. The five types of statement. Input Output Assignment

gaia
Download Presentation

310201 Fundamental Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 310201Fundamental 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; break; default: ProcessOther; }

  7. Repetition • While loops • Do … While loops • For loops

  8. While loop Sum = 0 ; Number = 5; while (Number > 0) { Sum += Number; Number -= 1; } 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!

More Related