Assignment No. 02 Semester: Spring 2020 cs304- object Oriented Programming

Download 192.33 Kb.
Size192.33 Kb.

Assignment No. 02
Semester: Spring 2020

CS304- Object Oriented Programming

Total Marks: 20

Due Date: 16/06/2020

Uploading instructions:

  • Your assignment should be in .CPP format (Any other formats like scan images, PDF, zip, doc, rar and bmp etc. will not be accepted).

  • Save your assignment with your ID (e.g. bc000000000.CPP).

  • No assignment will be accepted through email.

Rules for Marking:

It should be clear that your assignment will not get any credit if:

  • The assignment is submitted after due date.

  • The submitted assignment does not open, execute or file is corrupted.

  • Your assignment is copied from internet, handouts or from any other student.

(Strict disciplinary action will be taken in this case).

Lectures Covered:

This assignment covers Lecture # 7-15.

Problem Statement

In Pakistan, universities have adopted the semester system for the purpose of education. In semester system, two types of formal exams (i.e. Mid Term Exam and Final Term Exam) are generally conducted in every semester. Each exam is composed of certain number of questions which can be of two types: multiple choice questions (MCQs) and descriptive questions.

Keeping in mind the above scenario, consider the following class diagram showing the composition relationship between Exam and Question classes.

Now, you are required to write a C++ program for above for above class diagram.

Solution Guidelines:

  • Carefully analyze the given class diagram and write code according to classes, attributes, functions and relationship mentioned in class diagram.

  • In Exam class, data member NoOfQuestions will have some fixed value. It is set to 2 to generate the sample output.

  • As one Exam is composed of many questions, so here you have to use the concept of array of objects. Size of array will be based on value of Number of questions. It is set to 2 to generate the sample output.

  • In Question class, all getter functions should be constant.

Sample Output:

Best of luck!

NOTE: Do not put any query on MDB about this assignment, if you have any query then email at

Furthermore, if any student found cheating from any other student or from online forums then he/she will be awarded ZERO right away and strict disciplinary action will be taken against the student.

Deadline: Your assignment must be uploaded/submitted on or before 16th June 2020.

Share with your friends:

The database is protected by copyright © 2019
send message

    Main page