Create a base abstract class Student and two derived classes OnlineStudent and InpersonStudent. Part 1: 10...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a base abstract class Student and two derived classes OnlineStudent and InpersonStudent. Part 1: 10 pts Create an enum Year having the values freshman, sophomore, senior, and junior. The class student should be abstract In base class student have the following private attributes: - firstName lastName year (of enum type Year). studentid (in format SS-XXXX) yearOfGraduation department courseFee And methods: +generateld() studentld should have the following format SS-XXXX First letter should be generated from first character of the firstName, second letter should be generated from the first character of lastName, followed by a -' and 4 random numbers. Eg. Abhishek Gaikwad might have id: AG-1234 (1234 generated randomly) toString() abstract method. Create appropriate constructors, getters, and setters for this base class Part 2: 5 pts Create a class called as InpersonStudent which extends Student. OnlineStudent has following attributes: - parkingFee numOfClasses semesterFee And the following methods. + calculateSemesterFee() - If the student has less or equal or equal to 3 classes then semesterFee = courseFee* numOfClasses + parkingFee. If a student has more than 3 classes, for every class above 3, the student receives a 20% off. Eg. the Student who has 5 classes, for the first 3 classes normal fee (courseFee) but the next two classes will be 20% off. A student can have a maximum of 5 classes. toString()-prints all information about that student. Create appropriate constructors, getters, and setters for this class. Part 3: 5 pts Create a class called OnlineStudent which extends Student. OnlineStudent has the following attributes: - numOfOnlineClasses // classes which student is taking online numOfInpersonClasses classes which student is taking inperson And the following methods: + calculateSemesterFee()- The logic to calculate fees for inperson classes is similar to that of calculateSemesterFee() of the InpersonStudent class. However, online classes are marked up by an additional 20%. So if the student has 3 online classes and 2 inperson classes. Inperson classes will cost (courseFee* numOfInpersonClasses) and online classes will cost = courseFee * 1.2* numOfOnlineClasses. A student can have a maximum of 5 classes. +toString() - prints all information about that student. Create appropriate constructors, getters, and setters for this class. Part 4: 10 pts Create a StudentTester, and test all the scenarios above Question4: UML Diagrams (20 pts): Draw UML Class diagrams for Q2 and Q3. Your diagram should include appropriate symbols and notations, associations, cardinality, constraints, composition, and aggregation wherever possible. Create a base abstract class Student and two derived classes OnlineStudent and InpersonStudent. Part 1: 10 pts Create an enum Year having the values freshman, sophomore, senior, and junior. The class student should be abstract In base class student have the following private attributes: - firstName lastName year (of enum type Year). studentid (in format SS-XXXX) yearOfGraduation department courseFee And methods: +generateld() studentld should have the following format SS-XXXX First letter should be generated from first character of the firstName, second letter should be generated from the first character of lastName, followed by a -' and 4 random numbers. Eg. Abhishek Gaikwad might have id: AG-1234 (1234 generated randomly) toString() abstract method. Create appropriate constructors, getters, and setters for this base class Part 2: 5 pts Create a class called as InpersonStudent which extends Student. OnlineStudent has following attributes: - parkingFee numOfClasses semesterFee And the following methods. + calculateSemesterFee() - If the student has less or equal or equal to 3 classes then semesterFee = courseFee* numOfClasses + parkingFee. If a student has more than 3 classes, for every class above 3, the student receives a 20% off. Eg. the Student who has 5 classes, for the first 3 classes normal fee (courseFee) but the next two classes will be 20% off. A student can have a maximum of 5 classes. toString()-prints all information about that student. Create appropriate constructors, getters, and setters for this class. Part 3: 5 pts Create a class called OnlineStudent which extends Student. OnlineStudent has the following attributes: - numOfOnlineClasses // classes which student is taking online numOfInpersonClasses classes which student is taking inperson And the following methods: + calculateSemesterFee()- The logic to calculate fees for inperson classes is similar to that of calculateSemesterFee() of the InpersonStudent class. However, online classes are marked up by an additional 20%. So if the student has 3 online classes and 2 inperson classes. Inperson classes will cost (courseFee* numOfInpersonClasses) and online classes will cost = courseFee * 1.2* numOfOnlineClasses. A student can have a maximum of 5 classes. +toString() - prints all information about that student. Create appropriate constructors, getters, and setters for this class. Part 4: 10 pts Create a StudentTester, and test all the scenarios above Question4: UML Diagrams (20 pts): Draw UML Class diagrams for Q2 and Q3. Your diagram should include appropriate symbols and notations, associations, cardinality, constraints, composition, and aggregation wherever possible.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
Portray in words what transforms you would have to make to your execution to some degree (a) to accomplish this and remark on the benefits and detriments of this thought.You are approached to compose...
-
What is the output of the following statements? int a=2; float b=3.5; int c=a; printf("%d",c)
-
How much training time does it take to become a world-class breaststroke swimmer? A survey published in The American Journal of Sports Medicine reported the number of meters per week swum by two...
-
Market research has produced the following estimates of cross elasticity of demand. Branded cola and branded iced tea ............................... +1.5 Branded cola and own label cola...
-
Calculate the solution to the following SDE: \[d X_{t}=\alpha\left(m-X_{t} ight) d t+\sigma d B_{t}\] with \(X_{0}=x\). The process satisfying this equation is called the meanreverting...
-
A list of selected items involving Fischer Companys cash flow activities for 2016 is presented here: a. Patent amortization expense, $3,500 b. Machinery was purchased for $ 39,500 c. At year-end,...
-
. Assume that over the past 88 years, U.S. Treasury bills had an average return of 3.5% as compared to 6.1% on long-term government bonds. What was the average risk premium on the long-term...
-
What are the advantages or disadvantages of working in an employment scenario (where you are in a contract with your employer directly) or in a Laboure scenario (where you are a member of a union)?...
-
What is the purpose of the national accounting system known as the balance of payments?
-
It is the year 2020 and you have just been elected President of Pcoria, a small island nation. Congratulations! Your country has a health care system like the one in the US, except much smaller. The...
-
Ann Landers, an advice columnist, once wrote Nothing shocks me anymore, especially when I know that 50 percent of the doctors who practice medicine graduated in the bottom half of their class [14]....
-
An old joke is that a certain economics professor left Yale to go to Harvard and thereby improved the average quality of both departments. Is this possible?
-
Explain how you would obtain a simple random sample from this population: stocks traded on the New York Stock Exchange (NYSE).
-
How does global brand development and defining a global product differ from brand and product development on a local or even international level? Pricing strategies at each of these market levels are...
-
The following items were displayed in the statement of affairs for Lubbock Company: Fully secured liabilities ......... $90,000 Partially secured liabilities ....... 12,000 Unsecured liabilities...
-
(a) The longitudinal data set "v4c" is in the vertical format; transform it into the horizontal format. (b) Transform the data set you obtained in part (a) back into the vertical format.
-
Perform some exploratory analysis on the DTS study described above. (a) Compute the mean and standard deviation of the HamD scores for the two treatment groups at each time point. (b) Treat repeated...
-
In this question we develop a regression model to assess the treatment effect for stigma in the DTS study, controlling for demographics and baseline measurements. We will use the cumulative logit...
Study smarter with the SolutionInn App