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
The act of using computer equipment to “break into” the computer systems of others?
zlopas [31]

Answer:

Hacking.

Explanation:

Breaking into other systems sounds like hacking.

3 0
2 years ago
What is a basic operation of computers
ruslelena [56]
What is the context of the question? With all that you have provided my best guess would be "computational function/solving"
8 0
3 years ago
Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
Alekssandra [29.7K]

Answer:

Stack.

Explanation:

Topological sort requires a bit of addition to DFS algorithm.So DFS can be done by two ways that are either you can use recursion or you can use Stack data structure to implement DFS.

Since recursion uses stack memory when it makes recursive calls and if you want to do it iteratively you can stack data structure.

8 0
2 years ago
List out two ways to execute the script.​
castortr0y [4]

Answer:

1) Execute Shell Script Using File Name. Use the shell script file name to execute it either by using it's relative path or absolute path as shown below

2) Execute Shell Script Using Source Command.

7 0
2 years ago
Read 2 more answers
Write one line Linux command that performs the required action in each of the problems given below: (a) Find the difference in t
Luda [366]
You have to add the integer
8 0
2 years ago
Other questions:
  • Most Microsoft Windows fatal errors (blue screen of death) are caused by:
    14·1 answer
  • Which of the following statements about take home pay is TRUE?
    10·1 answer
  • Which feature is an interface between the user and the file system of a computer?
    6·2 answers
  • In Alphatech Systems, email software screens incoming messages by organizing them into mailboxes and identifying junk mail. As a
    13·1 answer
  • g If a class named Student has a data member named gpa , and one of its member functions has a parameter also named gpa , how ca
    7·1 answer
  • You want to look up colleges but exclude private schools. Including punctuation, what would you
    9·2 answers
  • Alice is working on a web page to attract the maximum number of people to join her cause. She wants to inform people about the b
    12·1 answer
  • Which of these is an expansion slot type?
    5·1 answer
  • What is a good theme statement for the short Pixar film "bao"?
    10·1 answer
  • What is computer fundamental ?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!