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 64 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 (this is an integer, not like the student…) getConcentration: returns concentration (ex: Data Science, NeuroScience, Bioinformatics, Cybersecurity, etc.)   Undergraduate:               Fields: honors (Boolean)               Methods: isHonors: returns honors (TRUE or FALSE) Undergrad(String major, double   Exchange:               Fields: country (String) year(string) (start date of the exchange program, stores Fall, Spring or Summer followed by the year e.g., Fall 2020)               Methods:                              getYear: returns year                              getCountry: returns country     Write a client class, called StudentClient. Create an object of class Undergraduate called Alex whose major is CS, gpa is 3.9, credit hours = 54, and honors = true. Create an object of class Graduate called Mary whose degree is “Masters”, years = 1, gpa is 3.91, major = “Computer Science” and concentration is “Data Science”, creditHours is 102. Print out Alex’s major, gpa, year, and use isHonors method to see if the he is an honors student. Print out Mary’s major, concentration, and years spent in graduate school. Create an object of class Exchange called YingShu, for an exchange student with Fall 2020 from Tiawan, fill out her credentials and print out her gpa, major, and country.

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

CSC 1302: PRINCIPLES OF COMPUTER SCIENCE II

Lab 6

 

How to Submit

Please submit your answers to the lab instructor once you have completed.

Failure to submit will result in a ZERO FOR THIS LAB. NO EXCEPTIONS

 

The class diagram with four classes Student, Graduate, Undergraduate, and Exchange is given. Write the classes as described in the class diagram. The fields and methods for each class is given below.

Student

Exchange

Graduate

Undergraduate

 

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 64 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 (this is an integer, not like the student…)

getConcentration: returns concentration (ex: Data Science, NeuroScience, Bioinformatics, Cybersecurity, etc.)

 

Undergraduate:

              Fields: honors (Boolean)

              Methods:

isHonors: returns honors (TRUE or FALSE)

Undergrad(String major, double

 

Exchange:

              Fields: country (String)

year(string) (start date of the exchange program, stores Fall, Spring or Summer followed by the year e.g., Fall 2020)

              Methods:

                             getYear: returns year

                             getCountry: returns country

 

 

  • Write a client class, called StudentClient.
  • Create an object of class Undergraduate called Alex whose major is CS, gpa is 3.9, credit hours = 54, and honors = true.
  • Create an object of class Graduate called Mary whose degree is “Masters”, years = 1, gpa is 3.91, major = “Computer Science” and concentration is “Data Science”, creditHours is 102.
  • Print out Alex’s major, gpa, year, and use isHonors method to see if the he is an honors student.
  • Print out Mary’s major, concentration, and years spent in graduate school.
  • Create an object of class Exchange called YingShu, for an exchange student with Fall 2020 from Tiawan, fill out her credentials and print out her gpa, major, and country.

 

hint: you can override toString() to print things and combine with parent classes.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 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