Java assignments of a foreign university

Source: Internet
Author: User

 

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. // write the file

 

The person class is as described below:

It contains four instance variables: one each forName, area, title, AndYearsofemployment. It shoshould have appropriate constructors andAccessorAnd
MutatorMethods. in addition, it shoshould 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 shocould return true, else it returns false. The gradstudent class definition shocould 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-jarStudentapp. jar.

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

 

Studentapp. Jar:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.