heyo - i made this program in visual j# and basically i cant seem to get the bufferedReader and readline/parseline working. I know its something weird for using doubles or something - i can get it to work at school but wont be back there till monday and i would like to continue playing with java. anyway, this program calculates averages and totals of a list of numbers typed in the command prompt:
import java.io.*;
class ARSEBISCUITS
{
public static void main(String args[]) throws IOException{
BufferedReader kbd1 = new BufferedReader(input);
//^i think this is a bit screwy
double e1 = 0;
double count = 0;
double sum = 0;
double average = 0;
System.out.print("Type in numbers to find the average - Type 00 to quit");
do
{
count++;
System.out.print("Enter your number");
e1 = readDouble(kbd1);
//^this line is the problem, i know its parse something but i dont know what
sum += e1;
} while (e1 != 00);
if (count != 0)
average = (sum / (count-1));
System.out.println("The Average is:" + average + "- The total is:" + sum);
}
}
i also just popped a spot on MY EAR GOD THAT HURT
thanks
import java.io.*;
class ARSEBISCUITS
{
public static void main(String args[]) throws IOException{
BufferedReader kbd1 = new BufferedReader(input);
//^i think this is a bit screwy
double e1 = 0;
double count = 0;
double sum = 0;
double average = 0;
System.out.print("Type in numbers to find the average - Type 00 to quit");
do
{
count++;
System.out.print("Enter your number");
e1 = readDouble(kbd1);
//^this line is the problem, i know its parse something but i dont know what
sum += e1;
} while (e1 != 00);
if (count != 0)
average = (sum / (count-1));
System.out.println("The Average is:" + average + "- The total is:" + sum);
}
}
i also just popped a spot on MY EAR GOD THAT HURT
thanks