1. Class Human: a. Fields: age (int), weight (double), height (double) b. Methods: getAge, getWeight, getHeight 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
Java
 
1. Class Human:
a. Fields: age (int), weight (double), height (double)
b. Methods: getAge, getWeight, getHeight
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 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.
 
mammal class given*
//In Mammal.java
Public interface Mammal
{
public double hairColor();
}
 
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.
b. Create an object of class Doctor
ii. Called jack whose specialty is “Dermatology”, years = 4, height is 173 cm, weight is 179 pounds and age is 40.
c. Print out the student’s major, GPA, year and age.
d. Print out the doctor’s specialty, height, weight and salary
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 fields and methods for each class is given below.
Mammal
Human
Student
Doctor
Transcribed Image Text: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 fields and methods for each class is given below. Mammal Human Student Doctor
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY