Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

University of Management and Technology

Graded Lab – Spring 2023

Course Title Object Oriented Programming Course Code CC1022

Course Instructor Maham Saleem Program Name BS(CS)


Section V6,7 Date 25-5-23
Total Marks 10 Due Data 25-5-23
Student Name Student ID
IMPORTANT NOTICE:
 Assignments submitted after the given time will not be marked.
 Copying your assignments from your fellows will result in zero/ 0 marks.

Question no 1.
Create a class “Employee” that contains two data members: an employee number (of type int)
and an employee compensation (of type float). Write a constructor that allows creation of objects with no,
all or limited information. Member function getEmployee() should allow the user to enter employee’s
data and a member showRecord() to display the information of the Employee. There should also be a
member function setEmployee that allows changes the employee number or his compensation.
Create at least three employees and display their record.
Question no 2.
Create a “Date” class that should consist of data members: month, day and year (all of type
integers). The class should also have two member functions get_date that allows the user to enter date in
31/12/97 (DD/MM/YY) format. Make a function show_date that displays the date entered by user in the
form “31 December 1997”.
Question no 3.
Make a class Student with the data members String Name, int ID_No, double GPA, int
semesters. All data members should be kept private. The system should be able to create an instance of
student even when the user has NO or limited record information of a student. There should be ONE
constructor only.
The class should also have function displaying the students altering the number of semesters.
Question no 4.
Define a class “Bank: that includes the following data members:

 Name of Depositor
 Account Number
 Balance Amount
To ensure data encapsulation, make these all-data members private. Implement or provide public getter
and setter functions to allow other parts of the application to access and modify these data members. Also
Update the Balance Amount by incrementing 20,000 in the Bank Account. Program should ask the user
about Name of Depositor, Account Number and Balance Amount at the time of Execution.

CLOS 1,2

Best of Luck!

You might also like