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”