
November 15th, 2012, 06:00 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 5 m 43 sec
Reputation Power: 0
|
|
|
I remember doing this assignment, cheater cheater pumpkin eater.
In anycase, you have to create the methods for getIntWithinRange, which is the whole point to the course, its teaching you data validation.
I'm not going to do your homework for you but I will walk you through the computer logic steps.
1. Method getIntWithinRange takes in a Scanner sc, and two integers, one for the minimum range, and maximum range.
2. You need to code out how compare the "nextInt()" from the scanner with the min/max and if its a valid value, store that variable in "testScore".
3. The only answer I will give you is to include sc.next(); to discard a false value.
I will help you if you post your attempt at this method.
|