0% found this document useful (0 votes)
10 views2 pages

Csc241oop Fa24bee3a A3

OOPS Assignment

Uploaded by

abubakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Csc241oop Fa24bee3a A3

OOPS Assignment

Uploaded by

abubakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMSATS University Islamabad

Department of Electrical & Computer Engineering


CSC241 Object Oriented Programming
Assignment No.: 03
[CLO-1 (C1): PLO-1, CLO-2 (C3): PLO-2]
Program: BEE-3(A) Total Marks: 250
Semester: Fall 2024 Post Date: 15th Nov. 2024
Instructor: Dr Riaz Hussain T.A.:
Due Date: Tuesday, 26th Nov. 2024

Note: See the method for submission at the end.

I know you can find tons of implementations available on the internet; even at the end of the shared url.
I request you to try these problems yourself. Take a small step at a time and gradually build. If you are
stuck at any point/error; think yourself, take a small break, discuss it with someone (may be your
instructor) and then again get back to the problem independently to get pass the hurdle. Spend some
time and debug; I also know that you can do it and you will.

Question No. 1: CLO-1 [15 × 3 = 45]


From Chapter 7, do the exercise questions:
a) 7 b) 8 c) 10

Question No. 2: CLO-2 [15 × 3 = 45]


From Chapter 8, do the exercise questions:
a) 3 b) 5 c) 9

Question No. 3: CLO-2 [10]


Create the UML class diagram for the class sterling of Ch-8 (Q-11).

Question No. 4: CLO-2 [50]


Derive a class called employee2 from the employee class in the EMPLOY program in this
chapter. This new class should add a type double data item called compensation, and also an
enum type called period to indicate whether the employee is paid hourly, weekly, or monthly.
For simplicity you can change the manager, scientist, and laborer classes so they are derived
from employee2 instead of employee. However, note that in many circumstances it might be
more in the spirit of OOP to create a separate base class called compensation and three new
classes manager2, scientist2, and laborer2, and use multiple inheritance to derive these three
classes from the original manager, scientist, and laborer classes and from compensation. This
way none of the original classes needs to be modified.

Question No. 5: CLO-2 [100]


Declare and define the class Cat in C++ as per the UML class diagram. Note that every constructor
must increment the catsCount and the destructor should decrement it.

Page 1 of 2 : Assignment-3 BEE-3A: Fall 2024: CSC241OOP Dr Riaz Hussain


Now, from Q2 you have a class Cat, but now I need PersianCats. These PersianCats have all the
attributes and behavior of the class Cat, however, they also have some specialized attributes and
behavior. One approach for implementing the class PersianCat could have been starting from scratch.
Luckily, through the provision of inheritance in OOP you can complete the implementation of the class
PersionCat with little effort. Override at least one inherited behavior in the derived class by redefining
the behavior. Also, specify where overloading has been used and where overriding.

Show how efficiently you can implement the derived/child class using the OOP paradigm. Don’t forget
to use the overloaded operator in the main program to demonstrate the ease of use it brings in.

To submit your work,

Use Online gdb compiler to code and test your program. To submit, create a folder
AssignmentNo-3.
For each programming question create a project with appropriate name (preferably
having question number) within the folder (If needed can create subfolder for each
programming question.) and submit.
In the class, you will submit the hard copy with the cover page and URLs of all the
programming questions along with the description of the core concept, analysis and
observation. For questions requiring with no programming task submit the handwritten/typed
answer.
Don’t forget to submit the pdf on MS Teams on or before the due date. Note, the URLs
must be clickable.

Page 2 of 2 : Assignment-3 BEE-3A: Fall 2024: CSC241OOP Dr Riaz Hussain

You might also like