

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
this document will help student and teacher to prepare assignment of object oriented programming
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Consider the following UML class diagram:
Semester: VI Batch: 2018 Due Date:18-Sep-2019 Max Marks: 10 Instructions: Attempt all questions
Consider an abstract class Person with three private attributes FirstName,LastName and Age. It has one abstract method String toString(); Also, consider an interface Payable that contains only one method double getPayment(). Class Staff has an additional attribute that is salary , which represents the monthly salary. Class Student has an additional attribute that is grades , which represents the grade character like A, B, C, D or F. In addition, the class Staff implements the interface Payable. The payment of the staff must return its annual salary (salary *12). The toString method of the each class must return all attributes of the class in text format. For a student, it returns the following string o Student: FirstName , LastName , Age , Grade For the Staff, it must return the following string o Staff: FirstName, LastName, Age, Salary. Application Class Write the application class and assing 3 objects of Student class and 3 objects of Staff class to the parent class reference array and print the details. Further more also assign 3 objects of Staff class to the interface reference array and print the details.