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
KengaRu [80]
3 years ago
9

Create a new Java project/class called Examine1. Prompt user as to how many numbers they would like to enter. Use a cumulative s

um loop to read in and sum that many numbers. Once all numbers entered, program should print out the sum total and average of those numbers entered by the user. Use the printf command to format. Paste code.
Computers and Technology
1 answer:
Zinaida [17]3 years ago
8 0

Answer:

Explanation:

The following code is written in Java and like requested prompts the user for a number to continue or a letter to exit. Then loops and keeps adding all of the numbers to the sum variable and adding 1 to the count for each number entered. Finally, it prints the sum and the average using printf and the variables.

import java.util.Scanner;

class Examine1 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int sum = 0;

       int count = 0;

       System.out.println("Enter a number to continue or a letter to exit.");

       while(in.hasNextInt()) {

           System.out.println("Enter a number:");

           sum += in.nextInt();

           count += 1;

       }

       System.out.printf("The sum is %s.%n", sum);

       System.out.printf("The average is %s.", (sum / count));

   }

}

You might be interested in
Can someone please please please help me!
vova2212 [387]
Is that apologetics?

5 0
3 years ago
What operating system are you using? On most computers, you can answer this question by right-clicking on the "My Computer" icon
Viktor [21]

Explanation:

hbbbbhygjjjjkllkkjhkkky

5 0
3 years ago
Read 2 more answers
Whose task it is to ensure that the product flows logically from one step to another?
vlabodo [156]

Answer:

The broad responsibility of a UX designer is to ensure that the product logically flows from one step to the next. One way that a UX designer might do this is by conducting in-person user tests to observe one’s behavior.

Explanation: I don't know if this is what your looking for though.

3 0
3 years ago
The IT infrastructure components should be evaluated based on their expected financial value. All of the following are used to q
vladimir2022 [97]

Answer:(A) usability

Explanation:

The term usability refers to the usage value of products, how much they can be used and their value after their use. So adding on these points usability helps to quantify the financial value of IT components.

5 0
3 years ago
A loop within another loop is known as a(n) ____ loop.
Natali [406]
Nested






..................................
4 0
3 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • What weight pencil is recommended for darkening lines and for lettering? *
    7·2 answers
  • Write a program in c++ that asks the user for a sequence of n​integers, where the user provides the number of elements n​ then e
    12·1 answer
  • Explain how the operating system controls the software and hardware on the computer?
    5·1 answer
  • Create a class named Invoicing that includes three overloaded computeInvoice() methods for a book store: see pages 196 for examp
    7·1 answer
  • Where on the internet can you find a site that will allow you to tour bill gates mansion
    8·2 answers
  • How to add a bill using the reciept capture?
    7·1 answer
  • Que es tarjeta madre resumen porfa
    13·2 answers
  • Pleasee helpppppppppppppppppppppp me!
    7·1 answer
  • Which of the following are acceptable to share? Check all of the boxes that apply.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!