国外某所大学的java作业题

Student Application

Create a base class Student that has Student ID (int), Student’s name (String), student’s address (String), and letterGrade (char). Now create classes UnderGradStudent, GradStudent and NonDegreeStudent that inherit from Student.

The UnderGradStudent has additional properties such as major (String), year (freshman, sophomore, etc), exam1Score (double), exam2Score (double), and exam3Score (double).

GradStudent has properties such as department (String), advisor (Person), thesisGrade (char) and examScore (double).

The NonDegreeStudent has properties such as creditHours (int), assignScore (double) and examScore (double). Create constructor, accessor, mutator methods for all these classes.

Letter Grade for each student type is to be computed as follows:

1. UnderGradStudent: gpa is computed based on the following information

Graded activity

Maximum Score

Weight

Exam1Score

50

25%

Exam2Score

100

45%

Exam3Score

250

30%

TotalScore

LetterGrade

>=85

A

>=70

B

>=60

C

< 60

F

2. GradStudent:

ThesisGrade

ExamScore

LetterGrade

A

Does not matter

A

B

>= 90

A

B

>= 80

B

B

< 80

C

C

>=80

C

C

< 80

F

3. NonDegreeStudent:

Graded activity

Maximum Score

Weight

AssgnScore

250

25%

ExamScore

100

75%

TotalScore

LetterGrade

>=80

A

>=70

B

>=55

C

< 55

F

Now write a driver program to do the following:

1. Accept input for new Students

2. Accept advisor details for an advisor and then list the names of all Students who have the same advisor. You will use the method in the Person class for this functionality.

3. List the name of the Students along with their letter grade.

4. Display student information for all the students that are there in the system.

5. Exit the system after writing all information to a file. //写文件

The Person class is as described below:

It contains four instance variables: one each for the name, area, title, andyearsOfEmployment. It should have appropriate constructors andaccessor and mutator methods. In addition, it should have a method to check if two persons are the same. This method will accept another person object as a parameter and check if the calling object and the parameter object both have the same name, area, title and yearsOfEmployment. If so, the method should return true, else it returns false. The GradStudent class definition should include a Person type as an instance variable.

See sample .jar (and .dat) program provided.

To execute the jar file

· Download the .jar file and the .dat file. Put them in the same folder. At the command prompt type injava –jar StudentApp.jar.

· This will enable you to see how the application should work.

StudentApp.jar:

你可能感兴趣的:(java)