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
You want to print only the fourth page of your research document. What would you do?
Tju [1.3M]
If the fourth page is what has the most of your information and you can base that one page on your whole topic, and its the only choice you have, then I advise you should do that.
3 0
3 years ago
Read 2 more answers
He is the person behind the development of electronic mail
wlad13 [49]
The person who created email was ray tomlinson
3 0
3 years ago
Which type of database program is Microsoft Access 2016?
nadya68 [22]

Answer:

O relational

Explanation:

If I'm wrong I'm so so sorry! But form my research it keeps saying its relational.

If I'm right please give me brainliest I really need it to level up so please help me!

If you don't know how to give brainliest there should be a crown underneath my answer you just have to click it.

Thank you and have a wonderful night,morning,afternoon/day! :D

6 0
3 years ago
Read 2 more answers
What is the right thing to do when you spot fake news​
LUCKY_DIMON [66]

Answer:

to tell the truth

Explanation:

l mean there is no reason to keep it secret

6 0
3 years ago
Write the count below the rests. <br><br> How do I do I do this?<br> Help guys
leva [86]
Well 1234 for the first one
7 0
3 years ago
Other questions:
  • Which utility would you use to return the common name of the computer you're at? Execute this command and submit screen shots.
    11·1 answer
  • Jed is the database administrator for a mid-sized computer component manufacturer. He is responsible for validating the data mod
    12·1 answer
  • A bank uses a computer program during the night to tell if the alarm should ring. Sensors in the bank set the following Boolean
    5·1 answer
  • While saving her word-processed academic documents, Ashley includes the subject, title, and the author's name in the properties.
    7·1 answer
  • PLEASE HELP what is the mechanical advantage of a wheel with a radius of 8.0 cm connected with a axle with a radius of 2.5 cm?
    12·2 answers
  • Actors,narratirs,and other people whi appear in video programs collectively called what?
    15·1 answer
  • Choose the correct term to complete the sentence.
    10·2 answers
  • HELP PLSSSSS!!! I WILL MARK BRAINLIEST FOR THE FIRST AND CORRECT ANSWER!!!
    14·2 answers
  • Q9. Complete the table with the name of the functions
    12·1 answer
  • Explain the risks to privacy from collecting and storing personal data on computer systems and the programmer’s role to safeguar
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!