a and b between 0 and
10. Prompt the user for the answer to a*b. Report whether their
answer is correct. Name the file and program
ch1sec3prob00.java. Worth 20pts. Use standard input to get the
integers from the user. Assume the user provides valid input.
| Input: | $ java ch1sec3prob00 |
| Output: | (user will enter the value after the question...) |
What is 5*6? 10
|
| Input: | $ java ch1sec3prob00 |
| Output: | (user will enter the value after the question...) |
What is 6*6? 36
|
ch1sec3prob05.java. Worth 20pts. Output good error messages for
incorrect input values and not providing the correct amount of inputs to the
program; output a single value otherwise. You do not need to handle
NumberFormatExceptions.
| Input: | $ java ch1sec3prob05 30 10 |
| Output: | 21.24829325564962 |
| Input: | $ java ch1sec3prob05 30 |
| Output: | Error you did not give only temperature
and wind speed. |
| Input: | $ java ch1sec3prob05 60 2 |
| Output: | Error input was invalid. Temperature
should be between -50 and 50. Windspeed should be between 3 and
120. |
ch1sec3prob28.java. Worth 40pts. Input from the command line
and Output a single number. Hint: This code requires a loop.
| Input: | $ java ch1sec3prob28 48 18 |
| Output: | 6 |
| Input: | $ java ch1sec3prob28 18 48 |
| Output: | 6 |
Math.pow, it is not appropriate for
integers, as doubles represent a different range of values
inaccurately. Hint: Stop your loop 1 iteration early to avoid "integer
overflow".
| Input: | $ java ch1sec3prob30 42 |
| Output: | |
1
|
ch1sec3bonus.java. Use
standard input to get the alterations from the user.
| Input: | $ java ch1sec3bonus |
| Output: | (user will enter the value after the questions...) |
Your account has $0.00.
|