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
The hexadecimal number system uses alphabets A to F to represent values_ to _
mash [69]

Answer:

they represent values 10 to 15

7 0
3 years ago
Read 2 more answers
What's your opinion on Pokemon​ and pixeldip
faust18 [17]

Answer:

Its a good game but an amazing show. 10/10

Explanation:

7 0
3 years ago
Audra is creating a training document and would like to include an image that she sees on her screen that she has marked up for
kupik [55]

Answer:

the first and last one

Explanation:

give me brainilest

4 0
3 years ago
Read 2 more answers
Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another n
slavikrds [6]

no longer returns an error but your math seems to have something wrong with it, always returns 0

Console.WriteLine("Enter a percentage here");

   int Percent = int.Parse(Console.ReadLine());

   Console.WriteLine("Enter your number here");

   int Number = int.Parse(Console.ReadLine());

   int result = Percent / 100 * Number;

6 0
3 years ago
When is an original work considered Public Domain? A. When posted via social media. B. When is it posted on the internet C. When
I am Lyosha [343]
<span>Best Answer is (D)
</span>

Any<span> materials not protected by copyright, patent laws or trademark are referred to as copyright. Generally, the public owns these works, and anyone is allowed to use public domain works without obtaining permission. There are various common ways that these works may end up arriving in the public domain. One of those ways includes the expiration of copyright. The copyright owner may also fail to follow renewal rules that govern copyright. </span>The copyright owner may as well decide to place his or her works deliberately in the public <span>domain.</span>

3 0
3 years ago
Other questions:
  • How has science fiction influenced technology
    7·2 answers
  • Quiz
    6·2 answers
  • How to write greater than or equal to in excel if function
    7·1 answer
  • Edhesive coding practice 3.4​
    13·2 answers
  • Audiovisual means that a presentation combines film and photos.<br> true or false?
    6·2 answers
  • I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that
    10·1 answer
  • How to beat level 50 in give up robot 2
    5·1 answer
  • On a piano, a key has a frequency, say f0. Each higher key (black or white) has a frequency of f0 * rn, where n is the distance
    15·1 answer
  • Which of the following is NOT one of the four benefits of using email?
    14·1 answer
  • Explain why it is important that the device registration is the last thing that is done in the initialization routine of a devic
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!