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
Rapid va rog!!!!!!! Am 30 minute la dispozitie!! PLSSS !!!!!
Stella [2.4K]

uhhk if r dB BBL I 6th cnn he'll of

8 0
3 years ago
Debate whether social networking is harmful or helpful to society.
Dmitriy789 [7]

Answer:

I believe that Social Networking <em>IS </em>helpful to society, but, people use it for wrong stuff.

5 0
2 years ago
1. According to the Department of Commerce, _________ percent of single moms in the US qualified as poor.​
Allisa [31]

Answer:

. According to the Department of Commerce, 34.0% percent of single moms in the US qualified as poor.​

Explanation:

8 0
3 years ago
It's safe to download files from the internet if u perform regular Windows security updates, that is all u need to protect your
Vlad1618 [11]

Answer

TRUE

Explanation

A computer virus is a self-replicating program which are malicious and are designed to infect and gain control over a computer without the owner's knowledge.

To protect your computer from viruses especially when downloading files from the internet, it is advisable for one to perform regular windows security updates. This is because because windows have malware definitions to its windows defender and security essential utilities.

7 0
3 years ago
Read 2 more answers
5-11) (Find the Smallest Value) Write an application that finds the smallest of several integers. Write a program which first as
Elanso [62]

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("How many numbers? ");

       int n = in.nextInt();

       int []intArray = new int[n];

       //Entering the values

       for(int i=0; i<intArray.length;i++){

           System.out.println("Enter the numbers");

           intArray[i]=in.nextInt();

       }

       System.out.println(Arrays.toString(intArray));

       int min =intArray[0];

       for(int i =0; i<intArray.length; i++){

           if(min>intArray[i]){

               min = intArray[i];

           }

       }

       System.out.println("The Minimum of the numbers is "+min);

   }

}

Explanation:

  • Using Java programming language
  • Prompt the user for the number of values
  • Using Scanner class receive and store in a variable
  • Create an array of size n
  • Using an for loop continuously ask the user to enter the integers
  • Print the array of integers
  • Using another for loop with an if statement, find the smallest element in the array of numbers
  • Output the the smallest number
8 0
3 years ago
Other questions:
  • Why do you think LinkedIn has become so popular?
    6·1 answer
  • ____ port is a connection in which eight data lines transmit an entire byte of data at one moment in time.
    12·1 answer
  • When pasting information copied from a Word document into an Excel spreadsheet, click in the cell that will be the _______ of th
    7·2 answers
  • Recently, your laptop won't power on, and the battery is not charging. You suspect the block on the power cord (also known as a
    5·1 answer
  • 2. a computer system designed to run games is called what?
    11·1 answer
  • Design a class named Employee. The class should keep the following information in member variables:
    5·1 answer
  • True or False: Mapping annotations are exclusive - an annotated method will only be accessible to requests sent to a matching UR
    14·1 answer
  • For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
    7·2 answers
  • You have been asked to advise a group of several universities who want to combine research efforts and store data in the cloud.
    9·1 answer
  • PLEASE HELP WILL MARK BRAINLIEST
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!