ITEC 120 | Back to Assignment index page |
Program 3 - Students
and grades Submit your program files in a folder called RU07 in your directory on neelix. |
Description: Write a Student class and a driver to compute student grades.
Write a Student class which keeps track of a student and grades for that student. Instance data for the student class should include:
The Student class will also have one static variable, count, which will count the number of students which were instantiated.
The Student class should have methods to do the following:
Write a driver called program3.java which lets the user enter information for students until they are done. The driver should ask for a student's first name, last name, quiz grades 1,2, and 3, midterm grade, and final exam grade. The driver will then output a nicely formatted grade report for the student. The driver will then ask the user if they'd like to enter information for another student (y or n).
When the user is done entering student
info, and types n to quit, the program will output the number of students entered
and the average of semester averages for all students entered.
Sample output:
Program Outputs | Please enter student's first name: |
User Inputs | Sam |
Program Outputs | Please enter student's last name: |
User Inputs | Smith |
Program Outputs |
Please enter grade for quiz 1: |
User Inputs | 7 |
Program Outputs |
Please enter grade for quiz 2: |
User Inputs | 9 |
Program Outputs |
Please enter grade for quiz 3: |
User Inputs | 8 |
Program Outputs | Please enter midterm grade: |
User Inputs | 77 |
Program Outputs | Please enter exam grade: |
User Inputs | 83 |
Program Outputs | Sam
Smith's Grade Report:---------------- Quiz 1: 7 Quiz 2: 9 Quiz 3: 8 Quiz average: 80.0 B Midterm: 77 C Final exam: 83 B Semester Average: 80.15 B ----------------------------------------- Would you like to enter another? (y or n) |
User Inputs | y |
Program Outputs | Please enter student's first name: |
User Inputs | Orville |
Program Outputs | Please enter student's last name: |
User Inputs | Jones |
Program Outputs |
Please enter grade for quiz 1: |
User Inputs | 9 |
Program Outputs |
Please enter grade for quiz 2: |
User Inputs | 6 |
Program Outputs |
Please enter grade for quiz 3: |
User Inputs | 7 |
Program Outputs | Please enter midterm grade: |
User Inputs | 77 |
Program Outputs | Please enter exam grade: |
User Inputs | 79 |
Program Outputs | Orville
Jones's Grade Report:---------------- Quiz 1: 9 Quiz 2: 6 Quiz 3: 7 Quiz average: 73.3 C Midterm: 77 C Final exam: 79 C Semester Average: 76.88 C ----------------------------------------- Would you like to enter another? (y or n) |
User Inputs |
n |
Program Outputs | The semester average for these 2 students is 78.52 |
TURNING IN YOUR PROGRAM: You will turn in two files. You'll have the driver program, named program3.java, and the Student class, named Student.java. Submit both files to neelix in a folder called RU07 in your folder.