Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Item Goal Task Description Getting a practical experience in Writing simple console application, using nested-if statement, switch-case statement. Write a program which prompts user for
Item Goal Task Description Getting a practical experience in Writing simple console application, using "nested-if" statement, "switch-case" statement. Write a program which prompts user for the number "X", reads it from the keyboard, and saves it in an int variable called "x". Then prints "One", "Two"...., "Nine" if the int variable "x" is 1,2,..., 9 and "Other" if "x">9, respectively. Use (a) a "nested-if" statement; (b) a "switch-case" statement. The output shall look like (user input-in green): -Enter number : 1 -Enter number x: 12 -One - Other Preparation Execution methodology No special preparation Remind that student should apply his or her knowledge of: how to use "nested-if" statement, "switch-case" statement Execute following steps: - Student should create a new blank Java Project in IDE. - Student should create his or her own Java class and provide all necessary code in a method main() - Student should use System.in and Scanner class to read x value from console Student should use (a) "nested-if" statement or (b) "switch-case" statement Student should use System.out.println(). Ask student to execute the program Evaluation the program must work correctly; Closure Issues discussion, on demand
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