Starting from:

$30

CSE1322-Assignment 1 Solved

a.     Write a definition of the class Tests such that an object of this class can store a student’s first name, last name, five test scores, average tests score and grade.  (Use an array to store test scores.) Add constructors and methods to manipulate the data stored in an object.  Among other things, your class must contain accessors, mutators, mechanisms to calculate grades, return grades, and modify individual test scores.  You must also write a mechanism which must return all object data (including student’s name, five test scores, average, and grade) as a string.  

 

b.     Write a program to calculate students’ average test scores and the grade.  (You will ask the user to input all students and their grades)

You may assume the following input data: 

Jack Johnson 85 83 77 91 76

Lisa Aniston 80 90 95 93 48

Andy Cooper 78 81 11 90 70

Ravi Gupta 92 83 30 69 87

Bonny Blair 23 45 96 38 59

Danny Clark 60 85 45 39 67

Samantha Kennedy 77 31 52 74 83

Robin Bronson 93 94 89 77 97

Sun Xie 79 85 28 93 82

Kiran Patel 85 72 49 75 63

 

Use an array of objects of the class Tests (designed in part (a) to store each student’s data.  The program should output data as close as possible to the following form: 

 

First Name      Last Name      Test1   Test2   Test3   Test4   Test5   Average Grade

Jack                Johnson          85.00   83.00    77.00   91.00   76.00   82.40       B

Lisa                 Aniston            80.00   90.00    95.00   93.00   48.00   81.20       B

Andy                Cooper            78.00   81.00    11.00   90.00   73.00   66.60       D

Ravi                 Gupta              92.00   83.00    30.00   69.00   87.00   72.20       C

Bonny              Blair                 23.00   45.00    96.00   38.00   59.00   52.20       F

Danny             Clark                60.00   85.00    45.00   39.00   67.00   59.20       F

Samantha        Kennedy          77.00   31.00    52.00   74.00   83.00   63.40       D

Robin              Bronson           93.00   94.00    89.00   77.00   97.00   90.00       A

Sun                 Xie                   79.00   85.00    28.00   93.00   82.00   73.40       C

Kiran                Patel                85.00   72.00    49.00   75.00   63.00   68.80       D

 

Class Average = 70.94

 

Review your pseudocode: 

Make any changes you need to based on the feedback you received from grading.

 

 

Start writing the code from your pseudocode:

Code the solution from your pseudocode beginning with part (a).  Remember that part (a) will be used in part (b), so make sure you write the code in a way that it can be used in part (b).  Code part (b). Compile and debug all parts of your program to ensure it is correct.  

 

Now make sure that your code is the best it can be.  Check formatting, prompts to the user, and make sure they are clear and help the user interact with your code in an easy manner.

 

Test:

 

Test your code with at least two sets of input (one of which should be the inputs included as part of this problem statement.)

 

Now make sure that your code is the best it can be.  Check your formatting, prompts to the user, and make sure they are clear and help the user interact with your code in an easy manner.

More products