国外某所大学的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:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值