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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Think about some of the most memorable and forgettable games ever created. they can be games that were discussed in this unit or otherwise. what are some of the consistent factors that made certain games memorable to you? what were some of the consistent factors that made certain games forgettable to you? why? explain.
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences of events that occur over time. purchases at stock exchanges--what’s being bought-- are one source of data with a natural ordering in time. given a long sequence s of such events, your friends want an efficient way to detect certain "patterns" in them--for example, they may want to know if the four events buy yahoo, buy ebay, buy yahoo, buy oracle occur in this sequence s, in order but not necessarily consecutively. they begin with a collection of possible events (e.g., the possible’ transactions) and a sequence s of n of these events. a given event may occur multiple times in s (e.g., yahoo stock may be bought many times in a single sequence s). we will say that a sequence s’ is a subsequence of s if there is a way to delete certain of the events from s so that the remaining events, in order, are equal to the sequence s’. so, for example, the sequence of four events above is a subsequence of the sequence buy amazon, buy yahoo, buy ebay, buy yahoo, buy yahoo, buy oracle their goal is to be able to dream up short sequences and quickly detect whether they are subsequences of s. so this is the problem they pose to you: give an algorithm that takes two sequences of even~s--s’ of length m and s of length n, each possibly containing an event more than once--and decides in time o(m n) whether s’ is a subsequence of s
Answers: 2
question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 22.06.2019 22:40
When you type the pwd command, you notice that your current location on the linux filesystem is the /usr/local directory. answer the following questions, assuming that your current directory is /usr/local for each question. a. which command could you use to change to the /usr directory using an absolute pathname? b. which command could you use to change to the /usr directory using a relative pathname? c. which command could you use to change to the /usr/local/share/info directory using an absolute pathname? d. which command could you use to change to the /usr/local/share/info directory using a relative pathname? e. which command could you use to change to the /etc directory using an absolute pathname? f. which command could you use to change to the /etc directory using a relative pathname?
Answers: 3
You know the right answer?
Assume that two-dimensional arrays are used to store information about students' grades. the first i...
Questions
question
Mathematics, 17.04.2020 16:21
question
Mathematics, 17.04.2020 16:21
question
Mathematics, 17.04.2020 16:42
Questions on the website: 13722367