COMP 3141: Object Oriented Design and Programming 3C/C++

Java Python COMP 3141: Object Oriented Design and Programming

Assignment 3 (10%)

Programming Questions for Module 8, Module 9, Module 10 and Module 11

Instructions:

There are one or more questions in each week. For each question, design, compile and run the program.

Submission Method:

In your computer, make subfolders named Module 8, Module 9, Module 10 and Module 11. Save all the files you develop for the questions into the appropriate folder. Once all the questions of Assignment 3 are complete, zip the four folders in ONE zip file titled Assignment 3 and send it to the Open Learning Faculty Member for marking.

Module 8

Question 1

Prog30.cpp is demonstrating inheritance as well as use of constructor and destructor. Complete this program.

Question 2

(Quadrilateral Inheritance Hierarchy) Draw an inheritance hierarchy for classes

Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class of the hierarchy. Make the hierarchy as deep as possible.

Module 9

Question 1

Complete the case study as explained the slides.

Question 2

(Payroll System Modification) Modify the payroll system discussed in the class. COMP 3141: Object Oriented Design and Programming Assignment 3C/C++ You are now required to include private instance variable birthDate in class Employee. Use class Date we have discussed in previous modules, Assume that payroll is processed once per month. Create an array of Employee variables to store references to the various employee objects. In a loop, calculate the payroll for each Employee (polymorphically), and add a $100.00 bonus to the person’s payroll amount if the current month is the month in which the Employee’s birthday occurs.

Other classes are:

.    SalariedEmployee.java,

.    BasePlusCommissionEmployee.java,

.    CommissionEmployee.java,

.    HourlyEmployee.java)

Module 10

Question 1

Complete the prog38.cpp to display random records from random file.

Question 2

Extend this to a menu driven program to create a random file, read it sequentially and read it randomly.

Module 11

Question 1

Develop the generic function to multiply and divide two numbers of any data type

Question 2

Use the class defined in module-9 having birthdate. Define a driver class to input data for the class. If the birthDate entered shows that the employee has his birthdate in the current month, throw an exception to wish him “Happy Birthday”         

  • 4
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值