Assignment: Write a program that prompts the user to enter 10 numbers, and then displays the mean and standard deviation of these numbers
I already have the source code all done. I just need this translated into a flowchart. Again I just need the flowchart, not any source code. I have already
provided the source code below. Need Flowchart version of my code
Here is the source code:
public class Mean_Standard_Deviation {
public static void main(String[] args) {
Scanner input = new
Scanner(System.in); //Scanner object for collecting user
input
double [] myArray = new double[10];
//Array that will hold 10 numbers from user input
double [] devArray = new
double[10]; //Array for holding deviation of each value in myArray
from the mean
double [] squaresArray = new
double[10]; //Array for holding squares of deviation
values
double mean = 0, sum = 0, result =
0, deviation = 0, sumOfSquares = 0;
// variables that will hold values
received from calculations by the program
System.out.print("Enter numbers:
"); //Prompt user to enter numbers
for (int i = 0; i <
myArray.length; i++) { //For loop that will continuously accept
user input
myArray[i] =
input.nextDouble();
sum +=
myArray[i];
}
System.out.println();
mean = sum/myArray.length;
//calculation of the average of the values entered by user
System.out.print("The mean is "+
mean); //display the average
System.out.println();
for (int i = 0; i <
devArray.length; i++) { //For loop that will subtract each value in
myArray from the mean and place in devArray
devArray[i] =
myArray[i] - mean ;
}
for (int i = 0; i <squaresArray.length; i++) {
//For loop that will place squares of each value in devArray into
squaresArray
squaresArray[i] = devArray[i] * devArray[i];
sumOfSquares += squaresArray[i]; // Each
element inside squaresArray will be added up to get the sum
}
result = sumOfSquares/(myArray.length - 1); // Dividing the
addition of the squares by 1 value less than length of myArray,
part of standard deviation form
deviation = Math.sqrt(result); // deviation variable initialized
with square root of result which gives standard deviation
System.out.print("The standard deviation is "+ deviation);
//display standard deviation
input.close(); //closure of scanner
object
}
}
Assignment: Write a program that prompts the user to enter 10 numbers, and then displays the...
Finish the given ProcessFile.java program that prompts the user for a filename and reprompts if file doesn’t exist. You will process through the file skipping any text or real (double) numbers. You will print the max, min, sum, count, and average of the integers in the file. You will want to create test files that contain integers, doubles, and Strings. HINT: Use hasNextInt() method and while loop. You may also want to use Integer.MAX_VALUE and Integer.MIN_VALUE for the initialization of...
need help editing or rewriting java code, I have this program
running that creates random numbers and finds min, max, median ect.
from a group of numbers,array. I need to use a data class and a
constructor to run the code instead of how I have it written right
now. this is an example of what i'm being asked
for.
This is my code:
import java.util.Random;
import java.util.Scanner;
public class RandomArray {
// method to find the minimum number in...
import java.util.Scanner; // TASK #1 Add the file I/O import statement here /** This class reads numbers from a file, calculates the mean and standard deviation, and writes the results to a file. */ public class StatsDemo { // TASK #1 Add the throws clause public static void main(String[] args) { double sum = 0; // The sum of the numbers int count = 0; // The number of numbers added double mean = 0; // The average of the...
Write a JAVA program that prompts the user for student grades and displays the highest and lowest grades in the class. The user should enter a character to stop providing values. Starter code: import java.util.Scanner; public class MaxMinGrades{ public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.println("Enter as many student grades as you like. Enter a character to stop."); double grade = input.nextDouble(); double minGrade = Double.MAX_VALUE; double maxGrade = Double.MIN_VALUE; while (Character.isDigit(grade)) { if (grade == 0)...
Could someone re-write this code so that it first prompts the user to choose an option from the calculator (and catches if they enter a string), then prompts user to enter the values, and then shows the answer. Also, could the method for the division be rewritten to catch if the denominator is zero. I have the bulk of the code. I am just having trouble rearranging things. ------ import java.util.*; abstract class CalculatorNumVals { int num1,num2; CalculatorNumVals(int value1,int value2)...
Program Requirements · The program prompts the user to enter a loan amount and an interest rate. · The application calculates the interest amount and formats the loan amount, interest rate, and interest amount. Then, it displays the formatted results to the user. · The application prompts the user to continue. · The program stops prompting the user for values after taking 3 loan amounts. · The application calculates and displays the total loan and interest amount and ends the program Example Output Welcome to...
In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read. Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. version1: use a while loop. version2: use a do-while loop. version 3: use a for loop. For each version, use a loop to input 10 int numbers from the user...
Write and submit the source code for the following program. The program will use an integer array of size 10 to store the prices of smartphones. It will then determine and print the prices of the most expensive and cheapest phones. Use the following variables: int[] prices = new int[10]; // Array of smartphone prices Assignment Ask the user for the price of each smartphone (using a for loop) Sort the list of smartphones (once) from low to high price...
In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read. Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. The program must be in one file. version1: use a while loop. version2: use a do-while loop. version 3: use a for loop. For each version, use a loop to...
1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in); } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...