subject

Assume that two-dimensional arrays are used to store information about students' grades. the first is called studentscores and contains the students' numerical scores as integers. the other is studentletters and contains the corresponding letter grades as a string (i. e. "a", "b", "c", "d", or "f"). each row represents an individual student and each column a different assessment.
for example, if studentscores[0][0] contains 92, then the contents of studentletters[0][0] will contain the corresponding letter grade. in this case, the letter grade is a because the professor has used a standard grading scale. note that the professor might choose a different grading scale. do not assume scores of 90 or above are the letter grade a.
public class gradebook
{
private int[][] studentscores;
private string[][] studentletters;
// constructors not shown
// postcondition: returns −1.0 if lettergrade does not appear in studentletters
// otherwise, returns the average of all studentscores with corresponding
// studentletters values that are equal to the parameter lettergrade
public double letteraverage(string lettergrade)
{
}
// other methods not shown
}
write the method letteraverage. this method returns a double representing the average (arithmetic mean) of the student scores that correspond to a given letter grade. the method letteraverage returns −1.0 if none of the student scores corresponds to the given letter grade.
for example, given the following two-dimensional arrays:
studentscores: 96 72 84 65 89 60
78 86 75 61 85 73
studentletters: a c b d a d
b b c d b c
the method call letteraverage("b") would return the number 83.25, which is the average of the four scores that correspond to the letter grade b.
the method call letteraverage("f") would return −1.0 because none of the studentletters elements are equal to f.
complete the method letteraverage below. be sure to include the method header.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:00, Treezy11
In outlook how can cherie look at the details of an event that appears on the month view of her calendar? check all that apply. by switching to the detail view by switching to the week view by switching to the day view by right-clicking on the event by double-clicking on the event by highlighting the event
Answers: 2
image
Computers and Technology, 22.06.2019 17:30, kallee10
The forerunner to cell phones, pdas, and smartphones was
Answers: 1
image
Computers and Technology, 22.06.2019 23:00, brookerebman15
Which type of tab stop is most for weights and measurements?
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, valeriegarcia12
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
You know the right answer?
Assume that two-dimensional arrays are used to store information about students' grades. the first i...

Questions in other subjects:

Konu
Social Studies, 10.09.2021 07:00
Konu
Social Studies, 10.09.2021 07:00
Konu
Mathematics, 10.09.2021 07:00