Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions