import java.io.*;
class Ex33
{
public static void main(String[] args)
{
Console console=System.console();
System.out.println("Please enter a number");
String input;
input=console.readLine();
int n1;
n1=Integer.parseInt(input);
double sum;
int LessThanAv;
for(count=0;count<100;count++)
{ sum=(n1+sum)/count;
System.out.println("Please enter the next number");
}
while(n1<sum;)
{
System.out.println(n1);
}
}
}
NewOrder -1 Posting Whiz
Recommended Answers
Jump to Post@NewOrder
Use Code Tags the next time you post code.Now when it comes to your program, first store all the numbers entered by the user in an Array. So you can …
Jump to Posti can get the average of the input.
but i need to keep a record of everything the user types... (All his numbers)
i need that record to compare to the average of all the numbers he used
Jump to Post@fresidue Sometimes the instructor wants the student to know how to work his way thru an array manually. You do need to know this. Using tools like the sort() method and copyOf() method doesn't let the student learn how to manipulate an array.
Jump to PostI STORED THEM. BUT HOW DO I CONVERT THEM BACK TO NUMBERS.
Nice attitude, but you might remember I mentioned something about ARRAYs and even pasted the same link to you twice.
You are instead using a String to store your numbers,hence the pains of getting them back. Heres a …
All 14 Replies
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
NewOrder -1 Posting Whiz
stephen84s commented: NO YOU DID NOT -1
NormR1 563 Posting Sage Team Colleague
fresidue 0 Newbie Poster
NormR1 563 Posting Sage Team Colleague
stephen84s commented: Exactly +5
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.