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 PostSorry, I missed your question?
Or are you just showing us your code?
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 PostAgain you have posted code with no explanation.
Does this code do what you want it to?
If not, show its output and explain what is wrong and what you'd like for it to output.
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.
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.