100% found this document useful (1 vote)
402 views

Assignment No 2 OOP

This document contains instructions for 5 assignments on object-oriented programming in C++. It provides details on base classes, derived classes, member functions, and tasks for each assignment, including accepting input, performing calculations, and displaying output. Students are instructed to submit the assignments on time to their Moellium account and not to copy work from others.

Uploaded by

Moon Mughal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
402 views

Assignment No 2 OOP

This document contains instructions for 5 assignments on object-oriented programming in C++. It provides details on base classes, derived classes, member functions, and tasks for each assignment, including accepting input, performing calculations, and displaying output. Students are instructed to submit the assignments on time to their Moellium account and not to copy work from others.

Uploaded by

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

Assignment No 2 OOP BSCS 2nd A + B Due Data: 23-06-2020

Don’t Copy from others if copied then marks will be zero


After Due Date No assignment is considered so please submit on time
Understanding of Questions is a Part of Assignment.
Upload this Assignment on Your Moellium Account

Major Assignment
Q1. Write a C++ program to define a base class Item (item-no, name,
price). Derive a class Discounted-Item (discount-percent). A customer
purchases 'n' items. Display the item-wise bill and total amount using
appropriate format.

Items discounteditem
Item_no Discountpercednt
Name Percentage
price Display
Input
output
Q2. Write a C++ program to design a base class Person (name, address,
phone_no). Derive a class Employee (eno, ename) from Person. Derive
a class Manager (designation, department name, basic-salary) from
Employee. Write a menu driven program to:

a. Accept all details of 'n' managers.


b. Display manager having highest salary.

Employee Manager
Person
Eno Deptname
name
designation Basicsalary
address
phno Input1 Input2
Input Output1 Output2
Output
higestsalarydetia
l
Q3. Create a base class Patient (pat-name, age, sex) and IPD (ward-no,
bed-no, charge-per-day). Derive a class IPD-patient from these two
base classes with no-of-days-admitted attribute. Use Multiple
Inheritence for this Question.

Patient IPD
Patientname Ward_no
Age Bed_no
Charge_per_day
Accept_details Accept_ipd_details
Display_detail Display_ipd_detail
s s

IPD_Patient
No_of_days_admit
input_details
Display_details
Q4. In a bank, different customers have savings account. Some
customers may have taken a loan from the bank. So bank always
maintains information about bank depositors and borrowers.

Design a Base class Customer (name, phone-number). Derive a class


Depositor(accno,  balance) from Customer.
Again, derive a class Borrower (loan-no, loan-amt) from Depositor.
Write necessary member functions to read and display the details of ‘n’
customers.

Customers Deposit Borrow


Name Accno Loan_no
Address Balance Loan_amt

Accept_details Accept_details1 Accept_details2


Display_detail Display_details1 Display_details2
s
Q5. Write class declarations and member function definitions for a C++
base class to represent an Employee (emp-code, name).

Derive two classes as Fulltime (daily rate, number of days, salary) and
Parttime (number of working hours, hourly rate, salary).
Write a menu driven program to:
1. Accept the details of ‘n’ employees.
2. Display the details of ‘n’ employees.
3. Search a given Employee by emp-code. Parttimeemplyee
Per_day_rate
Employee fulltimeemployee
Working_hours
Emp_no Daily_rate
Salary1
Name Days
Get1()
Get() Salary
Calculate1()
Getdata()
Show1()
Calculate()
Show()

You might also like