Question: I need help figuring out how to add something that make sure user enters no more and no less than 10 numbers into my code.

 I need help figuring out how to add something that make

I need help figuring out how to add something that make sure user enters no more and no less than 10 numbers into my code.

My code:

import java.util.Scanner; public class Statistics { public static void main(String[] args) { //Declare variables double mean; double deviation; double number; mean = deviation = 0; //Set them to 0 Scanner sc = new Scanner(System.in); //created a string and display a title of the program String title = ("******************************************************************** " + "***Project 2: Statistics - compute mean and standard deviation*** " + "********************************************************************"); Scanner scanner = new Scanner(title); //created a new scanner with specified string object //print the next lines System.out.println(scanner.nextLine()); System.out.println(scanner.nextLine()); System.out.println(scanner.nextLine()); //Prompt user to enter 10 numbers System.out.print("Please enter ten numbers(with spaces): "); // Compute mean and standard deviation for (int i = 1; i Write a program that prompts the user to enter ten numbers, and displays the mean and standard deviations of these numbers using the following formula: Create four methods: 1. First method should display a title of a program, prompt the user to enter ten numbers, using loop enter ten numbers, and calculated sum of numbers 2. Second method should calculate a mean 3. Third method should calculate a standard deviation 4. Fourth method should display the mean, standard deviation, student's name and date

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!