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]
3 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]3 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
Define client and.server​
sweet [91]

Answer:

Client-server model is a model is a distributed application structure that partitions

tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients.

3 0
3 years ago
What is the function of HTML?
Anastaziya [24]

Explanation:

HTML is used to create web pages, documents.

hope this helps u

4 0
2 years ago
Read 2 more answers
Read the paragraph.
aleksandrvk [35]

Answer:

I think sentence 3 bc it doesn't really make any sense Ik it's explaining it but it doesnt connect with the whole story as much I think it has to have more details

5 0
3 years ago
Read 2 more answers
Water is constantly in motion.<br> True or false
motikmotik

Answer: true

Explanation: yes water is constantly in motion

7 0
3 years ago
Which 3 file formats can be used for importing lists directly into quickbooks online?.
Natali5045456 [20]

Answer:

Explanation:

QBO

IIF

QBJ

8 0
2 years ago
Other questions:
  • HELP PLEASE
    7·2 answers
  • A typical serial cable has
    13·1 answer
  • Electronic files created on a computer using programs such as word software are considered to be
    15·1 answer
  • What is an additional clock tab
    11·1 answer
  • Which would be a responsible use of technology used by victims of cyberbullying?
    12·2 answers
  • What factor(s) should be considered when determining whether a business is too far based on the query and the user location? Sel
    10·1 answer
  • How to print wireless from laptop to samsung printer?
    6·2 answers
  • Wilma is looking for facts about social media for her research project. What fact should she use for her project?
    15·1 answer
  • You manage a network that uses switches. In the lobby of your building, there are three RJ45 ports connected to a switch. You wa
    5·1 answer
  • Select the correct answer from each drop-down menu. A company is recruiting for a web designer. What kind of candidate should th
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!