0% found this document useful (0 votes)
6 views

Assignment 1

Uploaded by

Saad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assignment 1

Uploaded by

Saad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

University of Central Punjab

Object Oriented Programming Program: BSCS


Assignment # 1 Section: C19
Total Marks: 15+15+10= 40 Due Date: 25-11-2024 (In Class)

Instructions: 1. Understanding of the problems is part of the assignments.

2. You will get Zero marks if found any type of cheating.

1 UCP asked to OOAD team to design software for employee management. An employee’s information
contains; employee code, name, date of joining, age, experience (no of years). Analyse the problem,
implement (interface and definitions) using C++ classes. Write a main function, create three objects of
employee and enter some data into it through setters and constructors by passing parameters. Then
ask the user to enter current date. Display the names of those employees whose tenure is 2 or more
than 2 years according to the given current date. Note. If we do not know the size of any variable, we
create a pointer

2 Write a class Book with three data members BookID, Pages and Price. It also contains the following
member functions:

The input_values() function used to input values in data members (BookID, Pages and Price)

The set() function is used to set the values of data members(BookID, Pages and Price) using

parameters

The show() function is used to display values of Book Object

The getPrice() function is used to return the value of Price

The program should create two objects of the class and input the values for these objects.

The first object should get the value of data members (BookID, Pages and Price) through the member
function input() which in non-parameterized member function.

The second object should get the values of data members (BookID , Pages and Price) through member
function set() using parameters.

Lastly the program should display the details of most costly book

3 Create a class called Person that has data members for name, age, and gender.
 Create setter and getter methods for each data member.
 Define a class called Person with data members for name, age, and gender.
 Create a constructor that takes name, age, and gender as parameters and initializes the data
members.
 Define setter methods for each data member (set_name, set_age, set_gender) that allow the data
to be modified.
 Define getter methods for each data member (get_name, get_age, get_gender) that allow the
data to be accessed

You might also like