Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. Create a class Person with the following attributes:
  2.  
  3. String Name
  4. Sting Email
  5. int Age
  6. Implement the following methods:
  7.  
  8. Identify(), which will print Name, Email, Age
  9. String getName(), which will return a String of the Person Name
  10. String getEmail(), which will return a String of the Person Email
  11. String getAge(), which will return an integer of the Person Age
  12. Create interface Worker with the following method:
  13.  
  14. int getSalary(), values can be between 20000 and 90000
  15. Create interface AcademicInterest
  16.  
  17. String getInterest(), Value can be only “Java”, “Management”, “Finance”
  18. Create a class Student which will extend Person and implement AcademicInterest with the following parameter:
  19.  
  20. int avgrade;
  21. and method:
  22.  
  23. int getAvgrade(), values ranging only between 5 to 10
  24. Create a class Teacher which will extend Person and implement Worker and AcademicInterest with the following parameter:
  25.  
  26. int rating;
  27. and methods:
  28.  
  29. int getRating(), values ranging only between 5 to 10
  30. Identify(), override method so it says he/she is a Teacher
  31. Create a class Plummer which will extend Person and implement Worker with the following method:
  32.  
  33. Identify(), override method so it says he/she is a Plummer
  34. ********************* MAIN TASKS *****************
  35.  
  36. 1. In the main method instantiate an array of 10 Persons
  37.  
  38. 2. You must create at least one object of type (Worker, Student, Teacher, Plummer).
  39.  
  40. 3. Create the following input menu:
  41.  
  42. 1) Identify all Workers that have a Salary lesser than 50000
  43.  
  44. 2) Identify all Teachers with a rating lesser than 8
  45.  
  46. 3) Count People with the same academic interest (example “Java :3”, “Management: 1”, “Economics: 1”, “Finance 2”
  47.  
  48. 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