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
Veronika [31]
3 years ago
7

Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o

f the series. The program should count all the numbers entered, compute the running total of the numbers and displays their count, total and average. Display average to decimal places.
Computers and Technology
1 answer:
Fiesta28 [93]3 years ago
5 0

Answer:

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count =0;

       int total = 0;

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

       int num = in.nextInt();

       while(num!=-1){

           total = total+num;

           count++;

           System.out.println("Enter the next number");

           num = in.nextInt();

       }

//Compute the average

       double average = (double) total/count;

//Outputs

       System.out.println("Total count of numbers entered "+(count));

       System.out.println("Sum of the numbers "+total);

       System.out.printf("Average is %.2f ",average);

   }

}

Explanation:

  • Using java programming language
  • Import scanner class to receive user input
  • declare variables count and total and initialize to zero
  • Prompt user to enter numbers
  • Use a while statement with the condition while(num!=-1)
  • Within the while body keep prompting user to enter a number, increase count and update total
  • when -1 is entered the loop breaks and average is calculated
  • Use printf() method to print average to 2 decimal places.
You might be interested in
Hi, I just ate a hot banana that I cooked in the oven.
mrs_skeptik [129]
Banana fish .. pain. all i know is pain.
4 0
4 years ago
Read 2 more answers
A company that provides finance services wants to shift to a mobile platform. What is the major advantage that the users of the
juin [17]
I think it is b but double check
6 0
3 years ago
Read 2 more answers
ASAP PLZ!!!!!! Select the correct answer from each drop-down menu. Complete the sentences related to the types of sample data. I
Anit [1.1K]

Answer:

Data mining is one of the activities in Data Analysis. ... On the other hand, Data Analysis tests a given hypothesis. While Data mining is based on Mathematical and scientific methods to identify patterns or trends, Data Analysis uses business intelligence and analytics models.

Explanation:

8 0
3 years ago
________ is a model of computing in computer processing, storage, software, and other services which are provided as a shared po
Rudiy27

Answer:

"Cloud computing" is the correct answer .

Explanation:

Cloud computing is defined as it provided the resources of the system like data storage etc on the demanding purpose. In cloud computing, it provided the resources without knowing the management. Social media is one of the examples of cloud computing.

  • Cloud computing is a model in the computer system that stores the bulk data provided the services to the user on demands.
  • Cloud computing acts as a shared pool of virtual resources on the internet.
6 0
3 years ago
_____ are used by teams of developers to manage changes to the code, so that changes are not lost or overwritten.
Amiraneli [1.4K]

In order to manage changes to a code, so that changes are not lost or overwritten, teams of developers use: <em>End-user license agreements</em>.

<h3>What is the End-User License Agreement (EULA)?</h3>

The End-User License Agreement (EULA) can be defined as a contract that dictates the rights a user has to use a software application in such a way that it protects the software vendor's intellectual property (IP).

Thus, in order to manage changes to a code, so that changes are not lost or overwritten, teams of developers use: <em>End-user license agreements</em>.

Learn more about End-user license agreements on:

brainly.com/question/24288054

7 0
2 years ago
Other questions:
  • Why would you use a database system instead of traditional file system
    6·1 answer
  • What is a fragment shader? Question 5 (3 marks) What is trilinear filtering?
    8·1 answer
  • Data that can be used to identity a single individual is known as
    10·1 answer
  • The difference between the various networks is the ______ of the coverage.
    11·2 answers
  • What does the shell of a operating system do?
    11·1 answer
  • Which type of memory helps in reading as well as writing data?
    7·1 answer
  • Helpppppppp!!!!!!!! Some program menus are the same in every program you open. Under the File menu, all of the following are the
    15·2 answers
  • Which soft skills would these mobile app developers need to use in the situations described?
    8·2 answers
  • Lyla is writing a program that uses a recursive method. Why might she want to use a recursive helper method?
    8·1 answer
  • joe is in the planning stages to make sure that an upcoming company promotion during a major sporting event will not overwhelm h
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!