Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

AP Computer Science 2-D Array Programming Assignment Write a program that calculates the test average for each student and the average for each test. TestScores

AP Computer Science 2-D Array Programming Assignment

Write a program that calculates the test average for each student and the average for each test.

TestScores File

Create a class TestScores that has a calcStudentAverage(int row), calcTestAverage( ), and calcCurvedAverage( ). There should be a default constructor and a constructor that has a 2-D array of test scores as a parameter. The class should contain one instance field, the array of test scores.

calcCurvedAverage( ) If every test score increases from the last test score for the entire quarter, the student earns the highest/last test score for his/her test average for the quarter. Otherwise, the average (mean) is calculated by calling the calcStudentAverage(int row).

The calcStudentAverage(int row) method will return the average of one students test scores.

The calcCurvedAverage( ) method will return a 1D array of student test averages.

The calcTestAverage( ) method returns a 1D array of test averages.

TestScoresTester File

Your program will create and assign the 2-D array of test scores in the test/client file called TestScoresTester. Each row represents the test scores for a single student and each column represents test scores for the same test. Pass the array of test scores to the class through the constructor. Call the calcCurvedAverage( ) and calcTestAverage( ) methods in the test file. Use the returned values and the original array to create the output.

Examples of 2-D Arrays: int[ ][ ] tests = { {80,90,100}, {88, 98, 87}, {78, 89, 92}};

int[ ][ ] tests = { {92, 84}, {79, 85}, {85, 90} ..};

Example of Output

Test Averages

Test 1 Test 2 Test 3 Average

Student #1 80 70 90 80

Student #2 78 88 98 98

Student #3 75 85 80 80

Test Average 77 81 89

Your program should output the test average for each student and the average for each test. The output should be organized in a format that is easy to interpret.

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

Step: 3

blur-text-image

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions