1 answer

Java Assume there is an initialized array called examScores with of size 40 with values already...

Question:

Java

Assume there is an initialized array called examScores with of size 40 with values already loaded ExamScores Index [0] [1] [2] [3] [4] … [39] ExamScores Content 100 96 82 88 84 … 76 Write a method named getAverage that returns the average of the scores in the examScores array; this method uses the getTotal method to find and return the result.


Answers

Here is your code..

public class JavaExample {

static int getTotal(int arr[])
{
   int total=0;
   for (int i = 0; i < 40; i++)
   total += arr[i];
       return total;
}
static int getAverage(int a[], int n)
{
int sum = getTotal(a);
return sum / n;
}
  
public static void main(String[] args)
{
int [] examScores = {100,96,82,88,84,52,41,54,74,89,75,14,25,56,18,91,47,71,23,35,69,74,55,98,52,32,14,25,11,27,84,56,62,87,58,49,67,52,36,76};
   System.out.println(getAverage(examScores, 40));
}
}

# 10 *Untitled (not saved) X public class JavaExample { static int getTotal(int arr[]) Woo OWN int total=0; for (int i = 0; i

.

Similar Solved Questions

1 answer
The Warren Watch Company sells watches for $30, fixed costs are $180,000, and variable costs are...
The Warren Watch Company sells watches for $30, fixed costs are $180,000, and variable costs are $13 per watch. What is the firm's gain or loss at sales of 5,000 watches? Loss, if any, should be indicated by a minus sign. Round your answer to the nearest cent. $ _____ What is the firm's gai...
1 answer
A non profit hospice centre in a small community received a generous gift from the family...
a non profit hospice centre in a small community received a generous gift from the family of patient who had recently died and family demand that put use that money for better purpose everyone made different views about using this money .. if conflict arise then how it could be resolved?...
1 answer
#3 is correct but I’m unsure about #4 3. Describe in words a laboratory procedure to...
#3 is correct but I’m unsure about #4 3. Describe in words a laboratory procedure to hydrolyze a disaccharide. -1n boiling wqter koen, Plore Gil S tor tyk, inforょ1 minute, ,.ie uonp netepen 4. Write out the chemical equation for the reaction in 3 (above). [Note: Just write the simple, ...
1 answer
If you were the manager of a large firm that is unable to achieve economies of...
if you were the manager of a large firm that is unable to achieve economies of scale, would you recommend that the firm should cease operations and close? Why or why not?...
1 answer
For the Aldol Condensation reaction, Acetophenone was reacted with either p-methoxybenzaldehyde, p-cholorobenzaldehye or 3,4-dimethoxybenzaldehyde. Explain the...
For the Aldol Condensation reaction, Acetophenone was reacted with either p-methoxybenzaldehyde, p-cholorobenzaldehye or 3,4-dimethoxybenzaldehyde. Explain the driving force for the condesation reaction. Why is water eliminated so easily?...
1 answer
How do you solve #-4x + 5= 53#?
How do you solve #-4x + 5= 53#?...
1 answer
What is the hydroxide ion concentration in a 0.030 M solution of HNO3 (aq) at 25˚C?...
What is the hydroxide ion concentration in a 0.030 M solution of HNO3 (aq) at 25˚C? A. 3.0 x 10^-5 B. 7.5 x 10^-10 C. 3.3 x 10^-13 D. 4.5 x 10^-11 E. 3.0 x 10^-2...
1 answer
21 of 22 Review | Constants | Periodic Table Part A A mixture of He, Ar,...
21 of 22 Review | Constants | Periodic Table Part A A mixture of He, Ar, and Xe has a total pressure of 2.50 atm. The partial pressure of He is 0.350 atm. and the partial pressure of Ar is 0.300 atm. What is the partial pressure of Xe? Express your answer to three significant figures and include the...
1 answer
1. Define the term, anorexia. 2. Define the cachexia. 3. Which pulmonary infections are associated with...
1. Define the term, anorexia. 2. Define the cachexia. 3. Which pulmonary infections are associated with cavitary lesions of the lungs? 4. Which mycobacterial species are included in the Mycobacterium tuberculosis Complex? List the 4 most common species. 5. Which organism in the M.tb Complex is often...
1 answer
According to boolean law: A + 1 = ? a) 1 b) A c) 0 d)...
According to boolean law: A + 1 = ? a) 1 b) A c) 0 d) A’...
1 answer
Question 5 (1d motion, constant a) A some moment in time, a car accelerates at a...
Question 5 (1d motion, constant a) A some moment in time, a car accelerates at a constant rate along a straight line from 10 m/s ending at 25 m/s after traveling a distance of 90 meters. Upon reaching 25 m/s, the clock inside the car reads 3 seconds. a. What is the acceleration of the car? b. At wha...
1 answer
Chancellor ltd. sells an asset with a $1.6 million fair value to sophie inc. sophie agrees...
chancellor ltd. sells an asset with a $1.6 million fair value to sophie inc. sophie agrees to make seven equal payments, each to be paid one year apart, commencing on the date of sale. the payments include principal and 6% annual interest. compute the annual payments.((fv of $1, pv of $1, fva of $1,...
1 answer
What is the interval of convergence of #sum (x-1)^n/ n^2#?
What is the interval of convergence of #sum (x-1)^n/ n^2#?...
1 answer
Select the best answer for each question. 1. A 46-year-old man has been taking clonidine for...
Select the best answer for each question. 1. A 46-year-old man has been taking clonidine for 5 months. For the last 2 months, his blood pressure has been normal. During this office visit, he tell stop taking the drug. What is the nurse's best response? s the nurse that he would like to a. I'...
1 answer
Page 2 (18 points) Determine the output of the following program. 1/ Sample Test #2 -...
Page 2 (18 points) Determine the output of the following program. 1/ Sample Test #2 - Problem 2 #include <iostream> using namespace std; int main() int A = 1, B = 40, C = 3, D = 99, E = 1, F = 30; while (A <B) { A+=2; B-=3; cout << "A = " << A << endl << "...
1 answer
- Your answer is partially correct. On July 1, 2020, Monty Co. pays $15,420 to Flounder...
- Your answer is partially correct. On July 1, 2020, Monty Co. pays $15,420 to Flounder Insurance Co.for a 3-year insurance policy. Both companies have fiscal years ending December 31. For Monty Co., journalize the entry on July 1 and the adjusting entry on December 31. (Credit account titles are au...
1 answer
Please show all work and explain steps. thanks! In a study of reaction times, the time...
please show all work and explain steps. thanks! In a study of reaction times, the time to respond to a visual stimulus (X) and the time to respond to an auditory stimulus (y) were recorded for each of 8 subjects. Times were measured in thousandths of a second. The results are presented in the ...
1 answer
Please help solve problem #14. Thank you! 383 Section 7.2 Estimating u When a Is Unknown In Problems 13-19, assume that...
Please help solve problem #14. Thank you! 383 Section 7.2 Estimating u When a Is Unknown In Problems 13-19, assume that the population of x values has an approximately normal distribution 13. | Archaeology: Tree Rings At Burnt Mesa Pueblo, the method of tree-ring dating gave the following years A.D...
1 answer
ZIPBIT common stock is selling at a P/E of 10.0 times trailing earnings. The stock price...
ZIPBIT common stock is selling at a P/E of 10.0 times trailing earnings. The stock price is $23.50. What were the firm's earnings per share? notume vening coming to set waves to samo come se The firm's earnings per share (EPS) is $ . (Round to the nearest cent.)...
1 answer
Identify expected interactions and synergies between traditional and alternative health practices.
Identify expected interactions and synergies between traditional and alternative health practices....