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
Ganezh [65]
3 years ago
8

Write a program that computes the average of a list of numbers entered by the user. The numbers are supposed to be in the range

50 – 100 (inclusive) and the user will indicate that he/she is done with data input by entering a value not in that range. At least one number will be in the range. Use a WHILE or a DO-WHILE loop.
Computers and Technology
1 answer:
Maru [420]3 years ago
8 0

Answer:

The answer to this question can be given as:

Program:

//import package.

import java.util.*;  

public class Main      //define the main class.

{

public static void main(String[] ar) //define main method.

{    

    int sum=0,avg=0,count=0,data;  //define varaible

    // Create a Scanner class object.    

    Scanner ob1 = new Scanner(System.in);  

    System.out.println( "enter number between 50 - 100 After done please insert 0:"); //message

    data = ob1.nextInt();  //input by user.  

    while (data >50 && data<100)   //number between 50 to 100

    {

        if(data!=0)  //condition

        {

            sum =sum+ data;        //add numbers.    

            data = ob1.nextInt();   //next input

            count++;  //count number.

        }

    }      

    System.out.println("The sum is :" + sum);  //print sum.

    avg=sum/count;

    System.out.print("The average is :" + avg);  //print average.

}

}

Output:

enter number between 50 - 100 After done please insert 0:

80  

89

90

96

66

89

0

The sum is :510

The average is :85

Explanation:

In the above program firstly we import java util package. This package is used to take input from the user. Then we declare the class that is main in this class we define the main function in the main function we define the variable that is sum, avg, count, and data. In the data variable, we take the input from the user. Then we define the while loop in this loop we define condition that number is greater then 50 and less than 100.in this loop we define if block in the if block we check that the number is not equal to 0. so it will sum all the elements and count the number inserted by the user. In the last, it will print the sum of the number and the average of the number.

You might be interested in
Clarissa is a computer programming consultant. When a client states that they have an extremely complex programming task, which
Ann [662]

Answer:i think its D it makes more sense also can i get brainliest

Explanation:

5 0
3 years ago
Read 2 more answers
A snapshot is most similar to which type of backup scheme
Alchen [17]

Answer:

A snapshot is most similar to incremental backup scheme

<u>Definition</u>

A backup process in which successive copies of data contain the portion that has changed since last copy was made.

<u>Explanation:</u>

Snapshot are similar to incremental backup because only those blocks that are changed after your most recent snapshot has been saved on device.

This is the reason, snapshots are similar to incremental backup schemes.

3 0
3 years ago
What application service allows you to decouple your infrastructure using messaged based queues?
vivado [14]

Answer:A) SQS

Explanation: Simple Queue Service (SQS) is Amazon based service that deals in queue that decouples the micro-services infrastructure or applications.It has the benefit of maintaining of the security, eliminating complexity, transmitting the data reliably etc.

It also provides the service of the storing the message, storing it and other functioning without the integrity in its security or any other resource need.Thus, option(a) is the correct option.

6 0
3 years ago
Who invented computer ?​
liraira [26]

Answer:

Charles Babbage invented computer.

hope this helps!

8 0
3 years ago
Read 2 more answers
Electronic ledger that tracks mathematical data
fenix001 [56]
<span>Spreadsheet software consists of an electronic ledger designed to perform mathematic calculations quickly </span>
6 0
4 years ago
Other questions:
  • Select the correct answer.
    8·2 answers
  • I need to write a program that accepts eight int values representing student test scores from the user and then displays each of
    14·1 answer
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • True or false? when intel places a sticker on computers showing their chip is inside, they are demonstrating their visible value
    7·1 answer
  • Websites whose URL’s contain tildes (~) are usually published by the government. TRUE or FALSE.
    8·2 answers
  • "Rights and duties are two sides of the same coin." Explain with examples​
    5·1 answer
  • Edhesive 7.6 lesson practice python
    11·1 answer
  • Use the drop-down menus to complete each statement. Two main versions of Outlook are the desktop app and the app. The has limite
    15·2 answers
  • Write a format operation that builds a string for the float variable amount that
    11·1 answer
  • How do we produce quality work in editing audio?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!