Question: Write a class for Student grade data and write a program to create an object from this class and use it to produce a report

Write a class for Student grade data

and write a program to create an object from this class and use it to produce a report

Write a class for Student grade data:

1. The class will have the following fields:

Student id

An array of ten test grades

2. Create void set methods to store values in Student id and the array

3. Create a value-returning get method to retrieve values from the fields, one for each field

4. Create a constructor with arguments for Student id and the array (use set methods)

5. Create a noArg constructor (use set methods, consider what the default values should be)

6. Create a method to calculate the total of test grades

7. Create a method to calculate the adjusted total, dropping the lowest test score and replace it with the highest test score (highest test counts twice, drop lowest test) see Lab05Logic

8. Create a method to calculate the average of the ten test grades based upon the adjusted total and round to the nearest integer

Create Lab05

9. Input data from the Lab05StudentFile.txt

10. Create an object from the Student class and use the constructor to place values into the object

11. Use the class method to calculate the total

12. Use the class method to calculate the adjusted total

13. Use the class method to calculate the average

14. Use data from the object and write the report to an output file

15. Accumulate and print the number of students

.

INPUT

File: Student file Lab05StudentFile.txt

Record: Student record

Field Data Type

Student id# 4 numbers (ex. 1234)

Ten test scores integers (valid numbers are 0 -100)

OUTPUT

File: Grade Report file Lab05Report.txt

Record:

Student Grade Report

ID# /-----------------------TEST Scores--------------------------/ Total Adj Total Avg

xxxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxxx xxxx xxx

xxxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxxx xxxx xxx

xxxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxxx xxxx xxx

Total students = xx

input file

1221 100 100 100 100 100 100 100 100 100 100 1222 87 87 87 87 87 87 87 87 87 87 1223 80 80 80 80 80 80 80 80 80 80 1224 77 77 77 77 77 77 77 77 77 77 1225 70 70 70 70 70 70 70 70 70 70 1226 67 67 67 67 67 67 67 67 67 67 1227 60 60 60 60 60 60 60 60 60 60 1228 57 57 57 57 57 57 57 57 57 57 1343 90 85 80 65 75 95 85 75 80 94 1555 70 70 70 60 65 90 85 80 80 80 1856 60 0 45 68 89 67 60 50 75 80 1967 90 85 87 88 70 90 92 87 88 67 1987 68 68 68 68 68 68 68 68 68 100 1989 59 59 59 59 59 59 59 59 59 75 1991 100 90 75 85 90 88 79 88 91 90 1993 91 90 75 85 90 88 79 88 91 90

stuent class

//class constructor public Student(int inStudentId, int [ ] inStudentGrades) {//begin method setStudentId (inStudentId); setStudentGradeArray(inStudentGrades); }//end method

//class default constructor public Student() {//begin method int tempArray [ ] = {0,0,0,0,0,0,0,0,0,0}; setStudentId (0); setStudentGradeArray(tempArray); }//end method

public void setStudentGradeArray (int [ ] inStudentGrades) {//begin method for (int c = 0; c<10; c++) studentGrades [c] = inStudentGrades [c]; }//end method

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!