Answered step by step
Verified Expert Solution
Question
1 Approved Answer
b. Write the definition of the class Tests such that an object of this class can store a student's first name, last name, five
b. Write the 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 the test scores.) Add constructors and methods to manipulate data stored in an object. Among other things, your class must contain methods to calculate test averages, return test averages, calculate grades, return grades, and modify individual test scores. The method tostring must return test data (including student's name, five test scores, average, and grade) as a string. Write a program to calculate students' average test scores and the grade. You may assume the following input data: -Write the class Tests. It will be saved as Tests.java. Make sure to have the following in this class: a. Constructor for first name, last name, five tests scores (an array), average tests score and grade. b. Method to calculate the average c. Method to calculate the letter grade d. Set and Get methods for the names, and tests e. Get Grade method X Cut Java Programming: From Problem Analysis to Program Design f. Get Average method g. toString method -Create another java file to test the class. a. Use the data file I provided. b. Output to the screen not an output file. c. Take a screen shot of your output. 9-2 Jack Johnson 85 83 77 91 76 Lisa Aniston 80 90 95 93 48 Andy Cooper 78 81 11 90 73 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 Sheila Sunny 79 85 28 93 82 Kiran Smith 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 Jack Johnson Lisa Aniston Andy Cooper Ravi. Gupta Bonny Blair Danny Clark Samantha Kennedy Bronson Robin Sheila Kiran Sunny Smith Class average- 70.94 Testl Test2 Test3 Test 4 Test5 Average Grade 85.00 83.00 77.00 91.00 76.00 82.40 B 80.00 90.00 95.00 93.00 48.00 81.20 78.00 81.00 11.00 90.00 73.00 66.60 B 92.00 83.00 30.00 23.00 45.00 96.00 69.00 87.00 72.20 38.00 59.00 52.20 67.00 60.00 85.00 45.00 39.00 59.20 77.00 31.00 52.00 74.00 83.00 63.40 93.00 94.00 89.00 77.00 97.00 90.00 85.00 28.00 93.00 82.00 73.40 79.00 85.00 72.00 49.00 75.00 63.00 68.80 DUEADACD F F
Step by Step Solution
★★★★★
3.45 Rating (164 Votes )
There are 3 Steps involved in it
Step: 1
public class Tests private String firstName private String lastName private double testScores privat...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started