Time allowed: 90 Minutes+ UNIVERSITY OF GUJRAT Course Title: Object Oriented
1 hour for submission Mid Term Exam Spring 2021 Programming
Maximum Marks: 25 Computing & IT Course Code: CS-103, SE-103
Name: _________________ Roll No: ___________________
______________________________________________________________________
Attempt all questions. Each question carries equal marks:
Q1. A static member function can be called even if no objects of the class exist.
Your task is to write a program by using the concept of static features of the class
to justify the above given statement? (2.5 marks)
Q2. A class constructor initializes data members in two ways through
Assignment and through Initializer List. Based on your understanding compare
these to initialization techniques used by a class constructor to initializes data
members of class? (2.5 marks)
Q3. Give two reasons to justify the following statements. (2.5 marks)
• Structure objects are stored on stack.
• Class objects are stored on heap.
Q4. Whenever an object of a class is declared as a data member in another class it
is known as a container class. In the containership the object of one class is
declared in another class. Based on your understanding write a code to explain
containership and container class concept? (2.5 marks)
Q5. Composition and aggregation are two types of association which is used to
represent relationships between two classes. Your task is to compare these two
types of association briefly? (2.5 marks)
Q6. Write a program that counts the number of objects created and destroyed for
a particular class? (2.5 marks)
Write a time converter code using type conversion, with the help of constructors
and operator keyword. There should be two classes named as time24 and time12.
Time12 should have an overloaded constructor and operator type function.
Q7. 24-hour format to 12-hour format. (2.5 marks)
Q8. 12-hour format to 24-hour format. (2.5 marks)
Page 1 of 2
1 hour for submission Mid Term Exam Spring 2021 Programming
Maximum Marks: 25 Computing & IT Course Code: CS-103, SE-103
Name: _________________ Roll No: ___________________
______________________________________________________________________
Attempt all questions. Each question carries equal marks:
Q1. A static member function can be called even if no objects of the class exist.
Your task is to write a program by using the concept of static features of the class
to justify the above given statement? (2.5 marks)
Q2. A class constructor initializes data members in two ways through
Assignment and through Initializer List. Based on your understanding compare
these to initialization techniques used by a class constructor to initializes data
members of class? (2.5 marks)
Q3. Give two reasons to justify the following statements. (2.5 marks)
• Structure objects are stored on stack.
• Class objects are stored on heap.
Q4. Whenever an object of a class is declared as a data member in another class it
is known as a container class. In the containership the object of one class is
declared in another class. Based on your understanding write a code to explain
containership and container class concept? (2.5 marks)
Q5. Composition and aggregation are two types of association which is used to
represent relationships between two classes. Your task is to compare these two
types of association briefly? (2.5 marks)
Q6. Write a program that counts the number of objects created and destroyed for
a particular class? (2.5 marks)
Write a time converter code using type conversion, with the help of constructors
and operator keyword. There should be two classes named as time24 and time12.
Time12 should have an overloaded constructor and operator type function.
Q7. 24-hour format to 12-hour format. (2.5 marks)
Q8. 12-hour format to 24-hour format. (2.5 marks)
Page 1 of 2