Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Pre-Exam Class CSIT121 Fall 2000 Exam-II (Final Examination) TUESDAY DECEMBER 19th 8:30AM.

Similar presentations


Presentation on theme: "1 Pre-Exam Class CSIT121 Fall 2000 Exam-II (Final Examination) TUESDAY DECEMBER 19th 8:30AM."— Presentation transcript:

1 1 Pre-Exam Class CSIT121 Fall 2000 Exam-II (Final Examination) TUESDAY DECEMBER 19th 8:30AM

2 2 Pre-Exam Class CSIT121 Fall’00 The following topics are included in exam: (1) Top Down Design (2) Selection (3) Repetition (4) Function Arguments and Returning values (5) File Input and Output (6) Arrays and Structures (7) Classes

3 3 Exam Style Exam-II is similar in style and structure to Exam-I There are 15 MCQ type questions. In these questions, you will have to fill in the blanks, select one out of many choices, give a short answer or indicate true or false Each of these short questions carries one mark

4 4 Exam Style The remaining 15 marks are distributed in 5 long questions. These questions may have one or more of the following: Writing a program Detecting logical mistakes in a program Detecting typing mistakes in a program Converting one program into another

5 5 Exam Topics Top Down Design In this topic, we learned about writing the main() as “driver” function. Its only job is to initialize some variables and call other functions to do the job For example, in a menu driven program, main() calls a display function that displays choices Be careful to integrate all functions well and declare function prototypes before using

6 6 Exam Topics Selection In this topic, we applied decision logic to select between several choices We also learned how to write a selection condition expression, without any semicolons For example, if (x==5) cout<<“Bingo”; else cout<<“Try again”;

7 7 Exam Topics The selection expression is a logical expression that evaluates to true or false We also learned about using &&, ||, or ! Logical operators to write expressions If multiple integer or char choices are available, we can use switch-case statement

8 8 Exam Topics Repetition We used different variations of loops. For example, while (condition is true) {…}, do {…..} while (condition is true) We also used counter controlled loops for (count=1; count<=100; count++) cout<<count*count<<endl;

9 9 Exam Topics Function Arguments When a function is called, a number of data items can be passed to this function The data items passed are called arguments (or parameters) The number of arguments and their type is already specified in the prototype of the function and also the header of function

10 10 Exam Topics A function that takes two numbers and returns square of their difference PROTOTYPE diff_square(int,int,int&); FUNCTION HEADER diff_square(int num1, int num2, int& diffsq) { diffsq=num1-num2; diffsq= diffsq*diffsq; }

11 11 Exam Topics File I/O We learned about sequential file handling in our programs #include is required for file handling input file: ifstream file_handle_name output file: ofstream file_handle_name

12 12 Exam Topics Arrays and Structures We use arrays to group several related data items under a common name. All items must be of same data type We pass arrays to functions by reference. However, we can use keyword const to protect arrays that should not be modified

13 13 Exam Topics For grouping different types of data under a common name, we use structs. Arrays of structs serve the purpose of creating an information repository about several objects such as books, students etc. Unions recycle the memory space by keeping only one member active

14 14 Exam Topics Classes Classes are templates for defining objects Objects provide a public interface to their functions hiding implementation details Objects protect the private data from non- member functions thus making debugging easier

15 15 Exam Topics User defined classes We can define our own classes in header files and implement member functions in a separate program file A client program is written separately that declares objects belonging to classes and uses the objects to carry out required work


Download ppt "1 Pre-Exam Class CSIT121 Fall 2000 Exam-II (Final Examination) TUESDAY DECEMBER 19th 8:30AM."

Similar presentations


Ads by Google