Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how i want to create a coding by this question?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


siti umairah
how i want to create a coding by this question?
0 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners


Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee.

A person has a name, address, phone number and email address. A student has a matric number and status (year 1, year 2 or year 3). An employee has a department, salary and date hired.

Define a class named MyDate that contains the fields year, month and day. A lecturer has a rank (Lecturer, Senior Lecturer, Associate Professor or Professor).

An admin staff has a title (Assistant Registrar, Head Registrar or Registrar). Override the toString() method in each class (except MyDate) to display the class name and the personā??s name. Also define a suitable constructor for each class.

Draw the UML diagram for the classes. Write a test program named Asg1_3 that creates an object from each of these classes and invokes their toString() method.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com