Question: //please leave small little notes explaining code //must be in Java Task: The class diagram with four classes Mammal, Human, Student and Doctor is given.

//please leave small little notes explaining code

//must be in Java

//please leave small little notes explaining code //must be in Java Task:The class diagram with four classes Mammal, Human, Student and Doctor is

Task: The class diagram with four classes Mammal, Human, Student and Doctor is given. The Mammal class is given as well. Write down the remaining classes as described in the class diagram. The elds and methods for each class is given below. 1. Class Human: a. Fields: height (double) b. Methods: getHeight : returns height 2: Class Student: a. Fields: major (String), gpa (double), creditHours (int) b. Methods: getMajor: returns major getGpa: returns gpa getYear: returns freshman, sophomore, junior or senior as determined by earned credit hours: - Freshman: Less than 32 credit hours . Sophomore: At least 32 credit hours but less than 64 credit hours . Junior: At least credit hours SH but less than 96 credit hours - Senior: At least 96 credit hours 3. Class Doctor: a, Fields: years (int), Speciality (String) b. Methods: getYears: returns years getSpecialty: returns speciality getSalary: calculates salary. The base salary is 40,000 for the lSt year and for each additional year gets 5000 more. So, in second year the doctor gets 45,000, in third year he gets 50,000 and so on. //In Mammal.java class Mammal { - Senior: At least 96 credit hours 3. Class Doctor: :1. Fields: years (int), Speciality (String) b. Methods: getYears: returns years getSpecialty: returns speciality getSalary: calculates salary. The base salary is 40,000 for the 1St year and for each additional year gets 5000 more. So, in second year the doctor gets 45,000, in third year he gets 50,000 and so on. //In Mammal.java classMammal { private int age; private double weight; Mammal (float weight, int age) { this.age = age; this.weight = weight; } publicfloatgetWeight() { return weight; } public int getAge () { return age; 4. Write another client class. a. Create an object of class Student i. Called Alex Whose major is CS, GPA is 3.4, credit hours = 54, height is 170 cm, weight is 150 pounds and age is 18. 13. Create an object of class Doctor ii. Called jack whose specialty is \"Dermatology\

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!