1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mylen [45]
2 years ago
12

Create a program that contains 4 methods / functions... main(), getTestScores(), calcAverage(), and displayAverage(). The main()

method should call the getTestScores() method to get and return each of 3 test scores. The main function should then call the calcAverage() method and send the three scores down to calculate and return the average of the three test scores. The main() method should then call the displayAverage() method to display the average of test scores.
Computers and Technology
1 answer:
jeyben [28]2 years ago
8 0

Answer:

import java.util.Scanner;

public class  num6{

   static int getTestScores(){

       System.out.println("Enter the Score");

       Scanner in = new Scanner(System.in);

       int score = in.nextInt();

       return score;

   }

   static double calcAverage(int score1, int score2, int score3){

       return (score1+score2+score3)/3;

   }

   static void displayAverage(double ave){

       System.out.println("The Average is "+ave);

   }

   public static void main(String[] args) {

       int num1 = getTestScores();

       int num2 = getTestScores();

       int num3 = getTestScores();

       //Calling Calculate Average

       double average = calcAverage(num1,num2,num3);

       //Calling displayAverage

       displayAverage(average);

   }

}

Explanation:

  • Using Java programming Language
  • Create the four methods
  • getTestScores() Uses the Scanner Class to receive an in variable and return it
  • calcAverage() accepts three ints as parameter calculates their average and return it
  • displayAverage() Accepts a double and prints it out with a concatenated string as message
  • In the Main Method, getTestScores is called three times to obtain three numbers from the user
  • calAverage is called and handed the three numbers
  • printAverage is called to output the calculated average
You might be interested in
Cascading style sheets (css) use special hypertext markup language (html) tags to globally define font characteristics for a var
ehidna [41]
The statement that Cascading style sheets (CSS) use special hypertext markup language (HTML) tags to globally define font characteristics for a variety of page elements as well as how those elements are laid out on a web page is true. <span> CSS is a stylesheet language used to describe the presentation of a document written in HTML or XML.</span>
5 0
2 years ago
A mobile device you are troubleshooting is experiencing a sharp decrease in performance after an hour of operation. The user pow
Anna71 [15]

Answer:

Close or disable all unused running apps.

Explanation:

Closing programs running in the background on your computer or mobile device helps to free up system resources for your other programs. These problems can be resolved where your system is running slowly or two programs are trying to use the same device hence causing the device or system to drag.

5 0
2 years ago
Ontext clues can be used to determine the _____ of an unfamiliar word
Solnce55 [7]
Meaning of the word.

6 0
3 years ago
The ip address 221.1.10.53 /24 is a what type of address?
jekas [21]
It is a class C address.  Class C covers all addresses in the range 192.0.0.0 to 223.0.0.0.  The /24 represents the number of network bits in the address so we can work out that the subnet mask of this address would be 255.255.255.0.
8 0
3 years ago
System requirements that are important in determining if a software program will work on a computer are ____.
EastWind [94]
The RAM, System Storage ,CPU or GPU and Operating System.
5 0
3 years ago
Other questions:
  • Which are characteristics of pseudocode? Select all that apply.
    6·1 answer
  • Press the ____ key(s) to erase one character to the left of the insertion point.
    10·2 answers
  • What is the difference between a rendering engine and a browser engine?
    5·2 answers
  • . Why should we favor programming to interfaces over implementations?
    6·1 answer
  • What is the first and last value of i to be displayed by the following code snippet? int n = 20; for (int i = 0; i &lt;= n; i++)
    10·1 answer
  • Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
    6·1 answer
  • What is the difference between edge and core networks?
    13·1 answer
  • Allie is working on the development of a web browser and wants to make sure that the browser correctly implements the Hypertext
    7·1 answer
  • What is the age group for the silent genration
    10·1 answer
  • When delivering digital technologies to clients, what is a best practice to make those solutions sustainable?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!