Not yet.
Nested statements need to be indented 3-4 spaces.
The statements should NOT all start in the first column.
There are if statements and for statements that are missing {} for the code...
Type: Posts; User: Norm
Not yet.
Nested statements need to be indented 3-4 spaces.
The statements should NOT all start in the first column.
There are if statements and for statements that are missing {} for the code...
Its hard' to read and understand unformatted code.
This statement is a clue for how to write the input reading loop:
Assume the input ends with 0.
The code should test the input's value for 0...
The code is not properly formatted. Nested statements need to be indented 3-4 spaces.
The statements should NOT all start in the first column.
What happens when you compile and execute the ...
Ask the user how many numbers he is going to enter, and use that value to control how many times the loops goes around. That will require the user to do an accurate count before entering the data...
I suspect the program will continue to ask for numbers long after you get tired of entering them.
You need to have code that makes the loop stop looping. See post#8
Back tomorrow then.
If it executes and generates the right results, then it could be correct.
Did you fix the code for the problem I mentioned in post#8?
Did you try typing in 100 numbers as the program reads input?...
Here's a site with many coding conventions defined:
Code Conventions for the Java Programming Language: Contents
Look at some other postings on this site. Most have {}s
The code tags are good. Now it needs the { and }
If you keep entering numbers, The program will continue reading them forever. Try a few hundred to see.
This is a hint of what the code...
Put the following tag before the code:
<YOUR CODE GOES HERE>
Put the following tag after the code:
Here's a site with many coding conventions defined:
Code Conventions for the Java Programming Language: Contents
Is the program waiting for your input?
To see where the code is executing, add some println() statements that print out messages to show you where the code is being executed.
One potential...