JAVA Your teacher has created two arrays, each holding the results of tests, say Test 1 and Test 2. You need to create a new array which holds the averages of these two tests. You may assume that the first element of the first test array refers to the student who also has the grade in the first element of the second test, and the last element in each array are the grades the last student earned for each test. All students received grades for both tests, meaning both test arrays are of the same length. Complete the method, named makeAverage, in the class named Grades.java. There are two parameters to this method: the first is the integer array representing the grades of the first test, and the second is the array containing the grades of the second test. The new average array should be returned by the method. The grades should be treated as double variables. For example, consider the test grades for the five students in the following arrays:   [ 87 ]    [ 91 ]   [ 76 ]    [ 76 ]   [ 94 ]    [ 95 ]   [ 82 ]    [ 86 ]   [ 72 ]    [ 67 ] The first student has an exam average of 89.0 (= (87+91)/2 = 178/2), the second student has an exam average of 76.0 (= (76+76)/2 = 152/2), the third student has an exam average of 94.5 (= (94+95)/2 = 189/2), etc. Hence, the new average array should match the following:   [ 89.0 ]    [ 76.0 ]   [ 94.5 ]   [ 84.0 ]   [ 69.5 ]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section: Chapter Questions
Problem 5PP
icon
Related questions
Question

 JAVA

Your teacher has created two arrays, each holding the results of tests, say Test 1 and Test 2. You need to create a new array which holds the averages of these two tests. You may assume that the first element of the first test array refers to the student who also has the grade in the first element of the second test, and the last element in each array are the grades the last student earned for each test. All students received grades for both tests, meaning both test arrays are of the same length.

Complete the method, named makeAverage, in the class named Grades.java. There are two parameters to this method: the first is the integer array representing the grades of the first test, and the second is the array containing the grades of the second test. The new average array should be returned by the method. The grades should be treated as double variables.

For example, consider the test grades for the five students in the following arrays:

  [ 87 ]    [ 91 ]
  [ 76 ]    [ 76 ]
  [ 94 ]    [ 95 ]
  [ 82 ]    [ 86 ]
  [ 72 ]    [ 67 ]
The first student has an exam average of 89.0 (= (87+91)/2 = 178/2), the second student has an exam average of 76.0 (= (76+76)/2 = 152/2), the third student has an exam average of 94.5 (= (94+95)/2 = 189/2), etc. Hence, the new average array should match the following:

  [ 89.0 ] 
  [ 76.0 ]
  [ 94.5 ]
  [ 84.0 ]
  [ 69.5 ]

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning