300+ New Sale Items (Up to 80% Off Selected Brands)
September 27, 2011 @ 09:26 PM
AdnanToThe

Post: 583

Join Date: Feb 2009

Location: NYC

Helpz me outz ill send you noodz

import java.text.DecimalFormat; //for number formatting
import java.util.Scanner; //for keyboard input
//ADD AN IMPORT STATEMENT HERE //for using files
public class StatsDemo
{
public static void main(String [] args) //ADD A THROWS
//CLAUSE HERE
{
double sum = 0; //the sum of the numbers
int count = 0; //the number of numbers added
double mean = 0; //the average of the numbers
double stdDev = 0; //the standard deviation of the
//numbers
double difference; //difference between the value
//and the mean
//create an object of type Decimal Format
DecimalFormat threeDecimals =
new DecimalFormat("0.000");
//create an object of type Scanner
Scanner keyboard = new Scanner (System.in);
String filename; // the user input file name
//Prompt the user and read in the file name
System.out.println(
"This program calculates statistics"
+ "on a file containing a series of numbers");
System.out.print("Enter the file name: ");
filename = keyboard.nextLine();
//ADD LINES FOR TASK #4 HERE
//Create a File object passing it the filename
//Create a Scanner object passing it the
//File object.
//write a loop that reads from the file until you
//are at the end of the file
//read a double from the file and add it to sum
//increment the counter
//close the input file
//store the calculated mean
//ADD LINES FOR TASK #5 HERE
//Create a File object passing it the filename
//Create a Scanner object passing it the
//File object.
//reinitialize the sum of the numbers
//reinitialize the number of numbers added
//write a loop that reads until you are at
//the end of the file
//read a double value and subtract the mean
//add the square of the difference to the sum
//increment the counter
//close the input file
//store the calculated standard deviation
//ADD LINES FOR TASK #3 HERE
//create an object of type PrintWriter
//using "Results.txt" as the filename
//print the results to the output file
//close the output file
}
}

Instagram- @AdnanToThe http://twitter.com/#!/AdnanToThe http://adnantothe.tumblr.com/

September 30, 2011 @ 10:30 PM
CHIEFxIRONLUNG

Post: 792

Join Date: Feb 2008

Location: 973 New Jeru

Female n00dz first. LULZ>sad
October 2, 2011 @ 11:36 PM
Iggle

Post: 1135

Join Date: Nov 2007

dis ♥♥♥♥♥ serious?

#pedogangweindis


Please login first to reply.
Back To Top