object oriented programming Assignment 4, Assignments of Object Oriented Programming

this document will help student and teacher to prepare assignment of object oriented programming

Typology: Assignments

2019/2020

Uploaded on 10/25/2020

mehwish-mehmood
mehwish-mehmood 🇵🇰

2.3

(3)

6 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Question No 1:
Consider the following UML class diagram:
SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY
BI0NFORMATICS DEPARTMENT
FALL 2019
OBJECT ORIENTED PROGRAMMING (CS-224)
ASSIGNMENT 4
Semester: VI Batch: 2018
Due Date:18-Sep-2019 Max Marks: 10
Instructions:
Attempt all questions
pf2

Partial preview of the text

Download object oriented programming Assignment 4 and more Assignments Object Oriented Programming in PDF only on Docsity!

Question No 1:

Consider the following UML class diagram:

SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY

BI0NFORMATICS DEPARTMENT

FALL 2019

OBJECT ORIENTED PROGRAMMING (CS-224)

ASSIGNMENT 4

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.