Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer in Java Write a definition of the class Tests such that an object of this class can store a students first name, last

Please answer in Java

  1. Write a definition of the class Tests such that an object of this class can store a students 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 students name, five test scores, average, and grade) as a string.

  1. Write a program to calculate students average test scores and the grade. (You will ask the user to input all students and their grades) . I'm having trouble getting user data to be transfer between classes and want to see an example of it done correctly.

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 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

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 students 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

This data is just an example. The user needs to input their own data for each individual's name and scores. Thanks!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions