Write an abstract class Student that includes the following hidden attributes: id(int), name(String), major(String) and grade(double), then create setters and getters for them. Write two classes that inherited from Student: ItStudent and ArtStudent. The grade for ItStudent is calculated as: grade = mid*0.30 + project*0.30 + final*0.40 and the grade for ArtStudent is calculated as: grade = mid*0.40 + report*0.10 + final*0.50. Crate main class that achieve the following: a. Declare and initialize an array of five Student objects from both ItStudent and ArtStudent classes. b. Sort the Student objects by grade in descending order using functions. c. Save the sorted objects into text file.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 20RQ
icon
Related questions
Question

Write an abstract class Student that includes the following hidden attributes: id(int), name(String), major(String) and grade(double), then create setters and getters for them. Write two classes that inherited from Student: ItStudent and ArtStudent. The grade for ItStudent is calculated as: grade = mid*0.30 + project*0.30 + final*0.40 and the grade for ArtStudent is calculated as: grade = mid*0.40 + report*0.10 + final*0.50. Crate main class that achieve the following: a. Declare and initialize an array of five Student objects from both ItStudent and ArtStudent classes. b. Sort the Student objects by grade in descending order using functions. c. Save the sorted objects into text file.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT