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
I need help fixing this please
Shkiper50 [21]

Explanation:

I think that you might have used it a lot or its just a glitch and will come back after some time.

It might be that your screen cracked.

But try re-booting if that does not work, wait and take off the battery.

5 0
2 years ago
Read 2 more answers
Which compound is obtained by the oxidation of primary alcohol with nascent oxygen​
Nookie1986 [14]

answer:

what

Explanation:

8 0
2 years ago
Could someone give an example or tell me what all of these mean? (For internet source citing) Evaluation: • Domain Name: • Autho
koban [17]

Evaluation-the making of a judgment about the amount, number, or value of something; assessment

Domain Name-Is a websites name (ex-Google)

Authoritativeness-The quality of possessing authority. The quality of trustworthiness and reliability.

Accuracy-the quality or state of being correct or precise

Timeliness-the fact or quality of being done or occurring at a favorable or useful time.

Objectivity-the quality of being objective.

Writing Style and Mechanics-Style has to do with how a piece of writing sounds. Everyone has a style which develops along with their writing.

Paragraph structure: Each paragraph should begin with a topic sentence that provides an overall understanding of the paragraph. ...

Sentence length: Sentences should be kept as short as possible so that their structure is simple and readable.

Graphics-are visual images or designs

Links- is an open source text and graphic web browser with a pull-down menu system.

8 0
2 years ago
If you want to open an application that does not have a tile pinned to the start menu
guapka [62]
Search for it in the start menu. Once you find it, right click and press "Pin to taskbar."
6 0
3 years ago
Implement a sublinear running time complexity recursive function in Java public static long exponentiation (long x, int n) to ca
Charra [1.4K]

Answer:

Following are the code block in the Java Programming Language.

//define recursive function

public static long exponentiation(long x, int n) {

//check the integer variable is equal to the 0.

if (x == 0) {

//then, return 1

return 1;

}

//Otherwise, set else

else {

//set long data type variable

long q = exponentiation(x, n/2);

q *= q;

//check if the remainder is 1

if (n % 2 == 1) {

q *= x;

}

//return the variable

return q;

}

}

Explanation:

<u>Following are the description of the code block</u>.

  • Firstly, we define the long data type recursive function.
  • Then, set the if conditional statement and return the value 1.
  • Otherwise, set the long data type variable 'q' that sore the output of the recursive function.
  • Set the if conditional statement and check that the remainder is 1 and return the variable 'q'.
4 0
2 years ago
Other questions:
  • A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
    11·1 answer
  • In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
    12·1 answer
  • students at a camp can choose between boating and fishing in the morning and between hiking and horseback riding in the afternoo
    11·1 answer
  • What is the output of the following program?
    10·1 answer
  • An invisible path determining the way of travel from one place to another.
    10·1 answer
  • Select the correct answer.
    7·2 answers
  • What is the BCC feature used for?
    12·2 answers
  • One way to use contiguous allocation of the disk and not suffer from holes is to compact the disk every time a file is removed.
    13·1 answer
  • Brianna is feeling overwhelmed by the amount of digital
    13·1 answer
  • an engineer is writing a web application that requires some user input. the engineer has put a submit button on their page and n
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!