Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Trying to fix this error. Any pointers? You have been asked to extend a pre-existing class st udent that represents a college student. A student

image text in transcribedimage text in transcribedimage text in transcribed

Trying to fix this error. Any pointers?

You have been asked to extend a pre-existing class st udent that represents a college student. A student has a name, a year (such as 1 for freshman and 4 for senior), and a set of courses that heishe is taking. The Student class includes the following members: You are to define a new class called GradStudent that extends Student through inheritance. A. GradStudent should behave like a Student except for the following differences: - A grad student keeps track of a research advisor, which is a professor working with the student. - Grad students are considered to be 4 years further ahead than typical students. So, for example, a grad student in year 1 of grad school is really in year 5 of school overall. - Grad students can enroll in a maximum of 3 courses at a time. If a grad student tries to add additional courses heyond 3 , the course is not added to the student's set of courses. - Grad students pay tultion difterently than other students. If the grad student is enrolled in 1 course or no courses, the grad student pays a flat rate of tuition of $500.00. If the grad student is enrolled in 2 or 3 courses, heishe pays twice as much as the normal student rate for those courses. - It grad students work too much, they become "bumt out." A burnt-out student is one who is in hisher 5 th or higher year of grad school (gth or higher year of school overall) or one who is taking 3 courses. You should provide the same methods as the superclass, as well as the following new behavior. You must also make Gradstudent objects comparable to each other using the comparable interface. Gradstudents are compared by year in ascending order, breaking ties by count of courses in ascending order, and further breaking ties by advisor in ascending alphabetical order. In other words, a GradStudent object with a lower year is considered to be "less than" one with a higher year. If two students have the same year, the one with a lower count of courses is considered to be "less than" one with a higher course count. If the two students have the same year and the same number of courses, the one whose advisor's name comes first in alphabetical order is considered "less." (You should compare the strings as-is and not alter their casing, spacing, etc.) If the two objacts are the same by all three of these criteria, they are considered to be "equal

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

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

How can we analyze the data and draw conclusions?

Answered: 1 week ago

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago