Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create a class Person with the following attributes:
- String Name
- Sting Email
- int Age
- Implement the following methods:
- Identify(), which will print Name, Email, Age
- String getName(), which will return a String of the Person Name
- String getEmail(), which will return a String of the Person Email
- String getAge(), which will return an integer of the Person Age
- Create interface Worker with the following method:
- int getSalary(), values can be between 20000 and 90000
- Create interface AcademicInterest
- String getInterest(), Value can be only “Java”, “Management”, “Finance”
- Create a class Student which will extend Person and implement AcademicInterest with the following parameter:
- int avgrade;
- and method:
- int getAvgrade(), values ranging only between 5 to 10
- Create a class Teacher which will extend Person and implement Worker and AcademicInterest with the following parameter:
- int rating;
- and methods:
- int getRating(), values ranging only between 5 to 10
- Identify(), override method so it says he/she is a Teacher
- Create a class Plummer which will extend Person and implement Worker with the following method:
- Identify(), override method so it says he/she is a Plummer
- ********************* MAIN TASKS *****************
- 1. In the main method instantiate an array of 10 Persons
- 2. You must create at least one object of type (Worker, Student, Teacher, Plummer).
- 3. Create the following input menu:
- 1) Identify all Workers that have a Salary lesser than 50000
- 2) Identify all Teachers with a rating lesser than 8
- 3) Count People with the same academic interest (example “Java :3”, “Management: 1”, “Economics: 1”, “Finance 2”
- 4) Group Students and Teachers that share the same academic interest and have average grade and rating lesser than 8. (ex. Java: Dan, John, Daisy; Finance: Luke, Helen, Richie)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement