ALLAMA IQBAL OPEN UNIVERSITY
Level: BCS / BS (CS) / BIT: Spring 2008
Paper: Programming Language - I (3407) Maximum marks: 100
Time allowed: 3 Hours Pass marks: 40
Note: ATTEMPT ANY FIVE QUESTIONS. ALL QUESTIONS CARRY EQUAL MARKS
Q No. 1
a) How C++ is evolved from C language?
b) Explain the life cycle of a program. Describe the life cycle stages with diagram.
Q No. 2
What is reusability? Write a program in C++ to explain the concept of reusability in object orientation.
Q No. 3
Write note on the following with suitable examples:
b) Data hiding
Q No. 4
Differentiate between static memory and dynamic memory. Write a program in C++ to demonstrate the static and dynamic memory allocation and de-allocation.
Q No. 5
Create a class called time that has separate int member data for hours, minutes and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments.
Q No. 6
What is Array? Differentiate between one dimensional array and multidimensional array. Write a program in C++ to define a multidimensional array and accessing its elements.
Q No. 7
What is exception? Differentiate between single exception and multiple exceptions. Write a program in C++ language to handle the divide by zero exception.
Q No. 8
a) Differentiate between an abstract class and a concrete class with the help of a program written in C++.
b) Describe the difference between a friend function and a virtual function with the help of a programming example.
© 2014 Design by w3layouts