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
Nat2105 [25]
3 years ago
6

Write a program that asks the user to input four numbers (one at a time). After the four numbers have been supplied, it should t

hen calculate the average of the four numbers. The average should then be displayed.
Computers and Technology
1 answer:
nika2105 [10]3 years ago
6 0

Answer:

<u>Output</u>

Enter first number:  

1

Enter second number:  

2

Enter third number:  

3

Enter fourth number:  

4

Average: 2.5

Explanation:

Below is the java program to calculate the average of four numbers:-

import java.util.Scanner;

public class Average {

public static void main(String[] args){

 int a,b,c,d;

 double average=0.0;

 Scanner s=new Scanner(System.in);

 System.out.println("Enter first number: ");

 a=s.nextInt();

 System.out.println("Enter second number: ");

 b=s.nextInt();

 System.out.println("Enter third number: ");

 c=s.nextInt();

 System.out.println("Enter fourth number: ");

 d=s.nextInt();

 average=(a+b+c+d)/4.0;

 System.out.println("Average: "+average);

}

}

You might be interested in
Which of the following can a cell contain?
Ksju [112]
The answer is choice D-All of these :)
8 0
3 years ago
Read 2 more answers
If you have questions about taxes, where can you go to get answers?
Andrews [41]

Answer:

Explanation:

i was told to paste this to other comment sections sooo...HEY PLS DON'T JOIN THE ZOOM CALL OF A PERSON WHO'S ID IS 825 338 1513 (I'M NOT SAYING THE PASSWORD) HE IS A CHILD PREDATOR AND A PERV. HE HAS LOTS OF ACCOUNTS ON BRAINLY BUT HIS ZOOM NAME IS MYSTERIOUS MEN.. HE ASKS FOR GIRLS TO SHOW THEIR BODIES AND -------- PLEASE REPORT HIM IF YOU SEE A QUESTION LIKE THAT. WE NEED TO TAKE HIM DOWN!!! PLS COPY AND PASTE THIS TO OTHER COMMENT SECTIONS

4 0
3 years ago
Assume the secret key is: (1, 2, 3, 4) -&gt; (3, 1, 4, 2); assume the plaintext THEYLOVEIT. If the sub-block length is 3, what i
Alex777 [14]
I belive their were answer chocies to this question am i right 

8 0
3 years ago
Explain how to number text in a document​
uranmaximum [27]

Answer:

Lol

Explanation:

Yes iri

8 0
3 years ago
Read 2 more answers
2. Which of the following is not one of the guidelines for using instant messaging?A.You can use in place of all face-to-face co
Alexxandr [17]

Answer:

A. You can use in place of all face-to-face communication.

Explanation:

Hope this helps

6 0
3 years ago
Other questions:
  • Which of the following events would most likely produce an earthquake
    7·1 answer
  • Driver’s License Exam The local driver’s license office has asked you to create an application that grades the written portion o
    9·1 answer
  • Describe the relative benefits of routing over a broadcast style of communication. Is routed traffic more secure than broadcasti
    14·1 answer
  • Write a program that performs the following tasks: Display a friendly greeting to the user Prompt the user for the value to conv
    13·1 answer
  • 50 POINTS!!!!!!!!!!!<br><br> Give at least two examples of how the transport layer is used.
    13·2 answers
  • The costs incurred when a firm buys on the marketplace what it cannot make itself are referred to as
    6·1 answer
  • Any anime weebs wanna talk
    7·2 answers
  • 3. Coaxial/telephone cable sends<br> during the data transmission<br> signal
    9·1 answer
  • Ema Company for business .
    14·1 answer
  • Ginny faced an application error while executing the recorder in opera. Which web browser is generally recommended to use with r
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!