Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help in this. Must be in java. You will have to use google translate to translate it to English. The class diagram is given

Need help in this. Must be in java. You will have to use google translate to translate it to English.

The class diagram is given with four classes Student, Graduate, Bachelor and Exchange. Write the classes as described in the class diagram. The 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 credit hours earned:  Freshman: less than 32 credit hours  Sophomore: at least 32 credit hours but less than 64 credit hours  Junior: at least 64 credit hours but less than 96 credit hours  Senior: at least 96 credit hours Graduate: Fields: degree (Chain) ("Master" or "Doctorate") concentration (String) years (int) (stores the number of years spent in graduate school) Methods: getYear: returns years (this is an integer, not like the student ...) getConcentration - Concentration of returns (e.g. data science, neuroscience, bioinformatics, cybersecurity, etc.) Undergraduate: Fields: honors (Boolean) Methods: isHonors: return honors (TRUE or FALSE) Exchange: Fields: country (String) year (string) (exchange program start date, Fall, Spring or Summer stores followed by the year, for example, Fall 2020) Methods: getYear: year of returns getCountry: returns the country  Write a client class, called StudentClient.  Create an undergraduate class object named Alex whose major is CS, gpa is 3.9, credit hours = 54, and honors = TRUE.  Create a Graduate class object named Mary whose title is Masters, years = 1, gpa is 3.91, major = Computer Science and concentration is Data Science.  Print Alex's major, gpa, year and use the isHonors method to see if he is an honors student.  Print major, concentration, and years spent in Mary's graduate school.  Create a class exchange object called YingShu, for an exchange student with Fall 2020, from Tiawan, and print their gpa, major and country. hint: you can override toString () to print things and combine them with the main classes.

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions