03-Week.docx

advertisement
Week 03 assignment
This program will use console I/0 (Scanner and System.out.print…)
Your file/class should be named SumSquares
When your program runs, it should:
1. Begin by printing your name
2. Ask the user to input an integer in the interval [0,10] for the start of summing.
3. If the user enters a number outside this range, it should prompt with a different message,
making it clear that the input should be in the proper range.
4. Ask the user for a second integer, in the range of [(first integer +1), 1000]
5. Validate the input as above.
6. Calculate the sum of the inverses of the squares of the numbers.
For example, if the first number is 3, and the second number is 7, it should calculate the sum
The output should be formatted as shown, one digit to the left of the decimal point, 6 after.
The .java file should be uploaded into the OIS dropbox Week 03.
Download