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
Help!!
Eduardwww [97]

the undo option is the right answer



8 0
3 years ago
Read 2 more answers
You are a very small company that sells healthcare insurance plans. You estimate that the breach of your customer database will
lozanna [386]

Answer:

C. Accept the risk

Explanation:

The first option is close but might not be suitable for a small company considering it's cost.

The second option which is to spend fifty thousand dollars per year on a data loss prevention solution is projected to cost you more than the risk.

The third option isn't specific and lacks a course of action.

6 0
3 years ago
In Microsoft PowerPoint, a _____ gives viewers a visual image of data, such as a line graph or a three-
Vera_Pavlovna [14]

Answer:

graph

Explanation:

I don't know anything else that would be a visual representation of data.

5 0
3 years ago
What is the size of the array shoeSize? double [] shoeSize = {8.5, 7, 12.5, 9.5, 9, 11.5, 6}
r-ruslan [8.4K]

The size of the array shoeSize? double [] shoeSize = {8.5, 7, 12.5, 9.5, 9, 11.5, 6} is 6

Explanation:

  • Arrays are zero-based : the seven elements of a 7-element array are numbered from 0 to 6. Hence, the size of the array is 6.
  • An array is collection of items stored at memory locations. The main aim of an array is to store multiple items of same type together.
  • An array is a collection of one or more values of the same type. Each value is called an element of the array.
  • The location of an item in an array is known as array indexing.
  • The first array index is 0 or 1 and indexes continue through the natural numbers.
  • The upper bound of an array is generally language and possibly system specific.
  • An array type is a data type that represents a collection of elements each selected by one or more identifying keys that can be computed at run time during program execution.

6 0
2 years ago
To use patterns and observations to say what happens next
posledela
You would need to show a pic
4 0
3 years ago
Other questions:
  • Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 300 milliseconds
    12·1 answer
  • Organisms that reproduce sexually​
    11·1 answer
  • How many questions must you answer in Brainly to be able to message people?
    6·2 answers
  • Each webpage is assigned a(n) ______, an address that identifies the location of the page on the Internet.
    6·1 answer
  • Which one of the following statements is true regarding the fetch-execute cycle? Each step of the fetch-execute cycle is perform
    15·1 answer
  • People are starting to type in whole questions rather than specific words, which leads credence to having _____ that have this a
    14·1 answer
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • Light the<br> Spark hop<br> Answer if ur a baddie;)))
    9·2 answers
  • What option can be used by a system administrator to ensure that dynamic updates are made only by known clients when you have a
    8·1 answer
  • personalization allows customers to modify the standard offering, such as selecting a different home page to be displayed each t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!