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
Mary is troubleshooting her company's LAN network. She finds out that data segments that the client is encoding are resulting in
kicyunya [14]

Answer:

Data link layer of OSI model is creating the erroneous segments

Explanation:

The Open System Interconnection (OSI) model is a conceptual framework about how communication occurs between devices over the Internet. It has seven layers, (Physical, Data, Network, Transport, Session, Presentation and Application layer). The purpose of this hierarchical layer system is to understand the structure of communication between devices and do troubleshooting easily if a fault occurs. As in this question, Marry is troubleshooting her company LAN network. She finds out that data segments that the client is encoding are resulting in errors in the encoding. Now the question arises, how she found the cause of the error. The OSI model helps her in understanding the problem.

As you know, the data link layer of the OSI model is responsible for the encoding and decoding of data segments. This layer ensures the reliability of the physical layer, and responsible to provide error-free transfer of data from one node to another on a network. It is also responsible for frame synchronization and flow control. The data link layer is divided into sub-layers:

1. Media Access Control Layer: this layer controls how a computer on the network gains access to the data and transmission permission.

2. Logical Link Control Layer: This layer controls frame synchronization, error checking and flow control.

Therefore, Marry founds data link layer of the OSI model is creating the erroneous segments in encoding.

6 0
3 years ago
Select all the correct answers.
oksano4ka [1.4K]

Explanation: 2 and 5

3 0
3 years ago
Read 2 more answers
someone please please help with this we have to make a sketch of a hydraulic spreader or cutter I chose the spreader now we have
AnnyKZ [126]

Answer:

heueururjrurh the best time to meet Vs t and get the use and may contain briy the best you had any y I have the same time ❤️ ry HR y regards Umesh he was a pleasure to have a great trip and u it

Explanation:

dgsisbsjdudb and I have a nice day best wishes for a few weeks back and I will send you an email from your NVR

8 0
3 years ago
Lots of Ways to Use Math.random() in JavaScript
Alja [10]

Math.random() is a built-in function in JavaScript that generates a random number between 0 and 1.

<h3>What is Math.random()?</h3>

Math.random() is a useful and versatile function that can add a element of randomness to your JavaScript programs.

This function can be used in a variety of ways in JavaScript programs, such as:

  1. Generating random numbers for games or simulations.
  2. Creating random samples for statistical analysis.
  3. Shuffling elements in an array for a random order.
  4. Selecting random items from a list for a quiz or survey.
  5. Creating unique IDs or keys for objects in a database.

To Know More About built-in function, Check Out

brainly.com/question/29796505

#SPJ4

8 0
1 year ago
How do I use files and functions in programming?
maw [93]

answer:

1.The program comes to a line of code containing a "function call".

2.The program enters the function (starts at the first line in the function code).

3.All instructions inside of the function are executed from top to bottom.

4.The program leaves the function and goes back to where it started from.

5.Any data computed and RETURNED by the function is used in place of the function in the original line of code.

3 0
2 years ago
Other questions:
  • Please look at picture
    10·2 answers
  • What is primary storage
    11·2 answers
  • What are the cause of eye strain during computer usage?
    7·1 answer
  • The maximum number of colors that should be used on a slide is _____. 2 4 6 8
    5·1 answer
  • Which are considered regulatory agencies? Check all that apply. WHO PPO HMO CMS CDC NIOSH
    11·2 answers
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • Why are computers better than humans at solving a problem like finding the shortest route between ten different cities?
    15·2 answers
  • How does social network use message to entertain?
    14·1 answer
  • Write an algorithm to verify a number as even​
    9·1 answer
  • Does anyone have any tips on how to begin a 10 page Capstone project paper? I've got to write a write a research paper on the ty
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!