Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Java program:

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 in the attachment.
//in Mammel.java
Public interface Mammal{
public double hairColor():
}
 
1. Class Human:
  • Fields: age(int), weight(double), height(double)
  • Methods: getAge, getWeight, getHeight

2. Class Student:

  • Fields: major (String), gpa (double), creditHours (int)
  • methods: getMajor: returns major, getGpa: returns gpa, getYear: returns freshman, sophmore, junior, senior as determined by earned credit hours
  • Freshman : less than 32 credit hours
  • sophmore: at least 32 but less than 64 credit hours
  • junior: at least 64 credit hours but less than 96 credit hours
  • senior: at least 96 credit hours

3.Class Doctor:

  • Fields: years(int), Speciality (String)
  • methods: getYears: returns years, getSpeciality: returns speciality, getSalary: calculates salary. base salary is 40,000 for the first year and for each additional year gets 5000 more. so in second year doctor gets 45000 and so on.

4. Write another client class.

  • create an object of class Student
    • Called Alex whose major is CS, GPA is 3.4, credit hours is 54, height is 170 cm, weight is 150 pounds and age is 18.
  • create an object of class Doctor
    • called Jack whose speciality is "Dermatology", years is 4, height is 173 cm, weight is 179 pounds and age is 40.
  • print out the students major, gpa, year, and age
  • print out the doctor's speciality, height, weight, and salary.
Mammal
Human
Student
Doctor
expand button
Transcribed Image Text:Mammal Human Student Doctor
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education