Better Math Example

1
2
/*In this program, we want the user to enter 10 numbers. Then, we will calculate and print out the average, and the lowest of the numbers.
This example is the fix from the buggy example at https://codepad.co/snippet/bAGpUdAb. More explanation is at https://medium.com/datadriveninvestor
    /debugging-pitfall-getting-scanner-input-in-java-41e42874cbe
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
In this program, we want the user to enter 10 numbers. Then, we will calculate and print out the average, and the lowest of the numbers.
This example is the fix from the buggy example at https://codepad.co/snippet/bAGpUdAb.

We've added an extra variable to store the next number in the list. A detailed explanation is available at https://medium.com/datadriveninvestor/debugging-pitfall-getting-scanner-input-in-java-41e42874cbe.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.