PreExam Class CSIT121 Fall 2000 - PowerPoint PPT Presentation

About This Presentation
Title:

PreExam Class CSIT121 Fall 2000

Description:

Click to edit Master text styles. Second level2. Third level. Fourth level. Fifth level ... A client program is written separately that declares objects belonging to ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 16
Provided by: junaidahm
Category:
Tags: preexam | class | click | client | csit121 | fall | to

less

Transcript and Presenter's Notes

Title: PreExam Class CSIT121 Fall 2000


1
Pre-Exam Class CSIT121 Fall 2000
  • Exam-II (Final Examination)
  • TUESDAY DECEMBER 19th 830AM

2
Pre-Exam Class CSIT121 Fall00
  • 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
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
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
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
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 (x5) coutltltBingo else
    coutltltTry again

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
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 (count1 countlt100 count)
  • coutltltcountcountltltendl

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
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)
  • diffsqnum1-num2
  • diffsq diffsqdiffsq

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

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
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
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
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
Write a Comment
User Comments (0)
About PowerShow.com