Question: Code a do-while loop that prints the monthName from October through December or it issues a Month not found! error message based on the value

Code a do-while loop that prints the monthName from October through December or it issues a "Month not found!" error message based on the value of a loop-control variable called month that has been declared and initialized to 1 Assume monthName has already been declared and initialized. Watch your spacing: double-space after colons, no spaces after the semicolon for a Java statement or a brace, no spaces before or after the parentheses of a test expression or method call 1. Use a switch statement which should include the default (no break statement after the default option). No need to code for the months preceding October. Code the Java statement for the case/default on the same line as the case 2. Use a post-increment. 3. Use printf0 with format specifiers. There is only ONE printfo statement. 4. No need to comment end braces. *C DoWhileSwitch SAMPLE OUTPUT*** Month not found! Month not found! Month not found! Month not found! Month not found! Month not found! Month not found! Month not found! Month not found! October November December //Repetition header //Begin switch /End switch //Java statement //Java statement WEND repetition
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
