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
How useful is the creation of folders for your computer
aleksandr82 [10.1K]
Depends on your operating system. For any system not Chrome OS, folder creation is an organizational must. Your hard drive stores data sequentially in the form of bits. Whenever you want to access information on your hard drive, the drive has to, much like an array in programming, run through all the data until it comes across the desired file. This, as you could probably imagine, is cumbersome. We, as the users, have the luxury of not having to deal with that kind of information acquisition. We can create folders and directories into which we can place files. The reason I mentioned Chrome OS earlier, was because Chrome OS stores just about everything in the cloud. There isn't any real need to create directories on a Chrome system because all of that data can be managed and stored on Google's servers, as opposed to in files and organized by yourself.
5 0
3 years ago
Please help me with this coding problem :)
leonid [27]

Answer:

ll and lll

Explanation:

list dont be a looser

8 0
2 years ago
What technology allows data to be stored in one place and be retrieved by many systems?
Mice21 [21]
ICloud is one of the many different tech options.
Hope I helped,
 Ms. Weasley
4 0
3 years ago
Which type of message format is designed to arouse curiosity, not showing the product or delivering quite enough information to
Anarel [89]

The type of message format that is designed to arouse curiosity by not showing the product or delivering quiet enough information to make sense is teaser. This is a way of providing information that is short and in which it does not identify the product or the whole message itself. 

7 0
3 years ago
An interrupt priority scheme can be used to ____. allow the most urgent work to be finished first make it possible for high-prio
Nana76 [90]

Answer:

All of the above

Explanation:

An interrupt priority scheme is a system which decides the priority at which various work is done and it perform all of the above mention task so therefore all of the above is the right answer.

5 0
3 years ago
Other questions:
  • A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the
    12·1 answer
  • Why is the protocol down, even though you issued the no shutdown command for interface vlan 99?
    5·2 answers
  • Press the _______ key to move to the next cell in a row.
    12·2 answers
  • Which CSS attribute would change an element's font color to blue
    15·2 answers
  • Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of
    8·1 answer
  • Question 2 of 3
    7·2 answers
  • 我对汉语的兴趣 làm đoạn văn theo đề trên​
    14·1 answer
  • Identify two real-world examples of problems whose solutions do scale well
    13·1 answer
  • Write an algorithm to find the average of three numbers: 10, 20, 30
    7·1 answer
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!