0% found this document useful (0 votes)
352 views2 pages

Final Project

The document provides instructions for a Java programming project involving classes that represent different types of people - Students, Lecturers, and Employees. The project involves: 1. Creating classes for Person, Student, Lecturer, and Employee with attributes and methods as specified 2. Creating a PersonViewer class to display information about Person objects 3. Creating a PersonViewerTest class to test the PersonViewer by creating objects of the different person types 4. Creating an EnhancedPersonViewer subclass that overrides the view method and adds specific view methods for each person type

Uploaded by

Abdlulu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
352 views2 pages

Final Project

The document provides instructions for a Java programming project involving classes that represent different types of people - Students, Lecturers, and Employees. The project involves: 1. Creating classes for Person, Student, Lecturer, and Employee with attributes and methods as specified 2. Creating a PersonViewer class to display information about Person objects 3. Creating a PersonViewerTest class to test the PersonViewer by creating objects of the different person types 4. Creating an EnhancedPersonViewer subclass that overrides the view method and adds specific view methods for each person type

Uploaded by

Abdlulu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Al-Azhar University Gaza Computer Programming 1

Faculty of EIT Java Project

Due Date: 900 1100 , 09 th


May 2017

Java Project
1. Create a Person class that should have the following protected data members (attributes):
Name, Email & Description. Define a
constructor with arguments (Name, Email ) and
also define getter methods for the attributes
(Name, Email & Description)

2. Create a Student class that extends the


Person class. As well as storing the students
name and email, also store their course grade
(e.g A, B, C) in a member variable. The grade should be accessible via a getGrade method.
class student Overrides the getDescription methods.For the implementation of
getDescription return a message along the lines of The grade of student is ......,
substituting the student actual grade.
3. Create a Lecturer class that extends the Person class. This class should also store the
subject that the lecturer teaches. Add a getSubject method, and implement
getDescription so that it returns a suitable message, e.g. Teaches Biology.
4. Create a third class, Employee that extends the Person class. This should also store the
name of the department the Employee works in (available via getDepartment). Again,
getDescription should return a suitable message.

5. Create class PersonViewer as following:


public class PersonViewer
{
public void view(Person person)
{
System.out.println("Person...");
System.out.println("Name: " + person.getName());
System.out.println("Email: " + person.getEmail());
System.out.println("Description: " + person.getDescription());
System.out.println("\n");
} }

6. Create a class called PersonViewerTest. Implement a main method that


a. Creates a PersonViewer object using the provided classes.
b. Creates instances of the Lecturer, Employee and Student classes and invokes
the view method of the PersonViewer on each of them.

7. Create a subclass of the PersonViewer object that has the following modifications:

a. Overrides the view method, and uses the instanceof test to determine the actual
type of the object (e.g. Employee), and then casts it appropriately.

1
b. Create three methods called viewPerson, that vary by their input parameters. I.e.
create one that accepts an Employee another that accepts a Lecturer and a third
method that accepts a Student.
c. Implement these methods so they write out to the console all information available
about the objects. E.g. for an Employee write out its name, email and department.

d. Finally add a main method to EnhancedPersonViewer that creates instances of


each different type of person, and then invokes the view method on each.

Main Menu Enter your Choice: 2


1- Student
A) Add Lecturer
2- Lecturer
D) Display Lecturers
3- Employee R) Return the Menu
4- Exit
Enter your Choice: 3
Enter your Choice: 1
A) Add Employee
A) Add Student C) Calculate yearly salary
C) Calculate Average D) Display Employees
D) Display Students R) Return the Menu
R) Return the Menu Press (r / R) key to return to the
main menu.

Important Notes:
The Last day of submission is 9,10/5/2017 9 11

You must submit the following :


All source files + All class files. Your work must be in a folder, its name is your name .
If a student copies the Project of another student, he/she will be assigned a zero
grade for the Project.
Maximum & Minimum group project 2 Student.
The date of discussion Lab 5 , 6 , 7

1 9/5/2017 10 - 9 Lab 5 , 6
2 9/5/2017 12 11 Lab 5 , 6


10/5/2017 9 - 8 Lab 5 , 6 ,7
10/5/2017 11 - 10 Lab 5 , 6 ,7
10/5/2017 1 - 12 Lab 5 , 6 ,7

Web Site: WWW.PALINFONET.COM

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy