Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The class diagram with four classes Student, Graduate and Undergraduate is given. Fields and methods for each class are given below. Student: Fields: major (String)

The class diagram with four classes Student, Graduate and Undergraduate is given. Fields and methods for each class are given below.

Student:

Fields: major (String)

gpa (double)

creditHours (int)

Methods:

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

Graduate:

Fields: degree (String) (masters or phd)

concentration (String)

years (int) (stores no. of years spent in grad school)

Methods: getYear: returns years

getConcentration: returns concentration

Undergraduate:

Fields: honors (Boolean)

Methods: isHonors: returns honors

  • Write another client class.
  • Create an object of class Undergraduate called John whose major is CS, gpa is 3.75, credit hours = 40 and honors = false.
  • Create an object of class Graduate called Zooey whose degree is Masters, years = 1, gpa is 4, major = CS and concentration is Bioinformatics.
  • Print out the Johns major, gpa, year and use isHonors method to see if the student is an honors student.
  • Print out the Zooeys concentration, years spent in grad school and major.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Optimizing Data Collection In Warzones

Authors: Aaget Aamber

1st Edition

B0CQRRFP5F, 979-8869065902

Students also viewed these Databases questions

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

Distinguish between formal and informal reports.

Answered: 1 week ago