Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA please help quick! i need done in 40 min Write a method that Inputs 5 one-digit numbers from the user. Make sure to use
JAVA please help quick! i need done in 40 min
Write a method that
- Inputs 5 one-digit numbers from the user.
- Make sure to use clear prompts. Use word ENTER in prompts to pass CodeGrade tests.
- Uses validation loops (or methods) so that the user cannot input anything other than one-digit number
- User must get error messages explaining why the value was rejected. All error messages must contain word ERROR in order to pass CodeGrade tests.
- The method calculates and prints out the largest of 5 integers provided by the user.
- See sample method calls below.
Method header: public static void problem02()
Add Java Doc comments before the method header.
This method is being tested automatically on CodeGrade with the help of regular expressions. Make sure to use the key words ENTER and ERROR in all caps as described above.
See sample method run below:
ENTER a one-digit number oops ERROR: Your input is not an integer. ENTER a one-digit number 876 ERROR: The number has more than one digit! ENTER a one-digit number 1 ENTER a one-digit number blah ERROR: Your input is not an integer. ENTER a one-digit number hehe ERROR: Your input is not an integer. ENTER a one-digit number 765 ERROR: The number has more than one digit! ENTER a one-digit number -9 ENTER a one-digit number 5 ENTER a one-digit number 2 ENTER a one-digit number 3 LARGEST = 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started