Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer to all the questions below: QUESTION 1 : Suppose that we have the following piece of the code in main ( ) float
Please answer to all the questions below:
QUESTION :
Suppose that we have the following piece of the code in main
float decimalNum decimalNum;
Scanner keyboard new ScannerSystemin;
System.out.printlnEnter a decimal number: ;
decimalNum keyboard.nextFloat;
Continue providing an if STATEMENT that assigns to decimalNum when decimalNum is greater than
QUESTION :
Suppose that we have the following piece of the code in main
float decimalNum decimalNum;
Scanner keyboard new ScannerSystemin;
System.out.printlnEnter a decimal number: ;
decimalNum keyboard.nextFloat;
Continue providing an ifelse STATEMENT that assigns to decimalNum when decimalNum is greater than or equal to otherwise assign to decimalNum
QUESTION :
Using the following chart, write an ifelse..if STATEMENT to select the rate depending on the sale amount listed on the left column:
Sale Amount Commission Rate
Less than or equal $
Greater $ and up to $
Over $
QUESTION :
Suppose we have the following lines of code in main
int integerNum integerNum;
Scanner keyboard new ScannerSystemin;
System.out.printlnEnter a number: ;
integerNum keyboard.nextInt;
System.out.printlnEnter another number: ;
integerNum keyboard.nextInt;
Continue providing a NESTED IF STATEMENT that performs the following
When integerNum is greater and integerNum is greater than
And when integerNum is greater than integerNum
then display the message:
integerNum and integerNum are greater than and integerNum is greater than integerNum
QUESTION :
Suppose we have the following lines of code in main
int option;
System.out.printlnMENU OF TASKS
Option
Option
Option
Exit.
;
System.out.printlnEnter a number from to to select an option or to Exit;
option keyboard.nextInt;
if option
System.out.printlnYou select OPTION ;
else if option option
System.out.printlnYou select OPTION or OPTION ;
else if option
System.out.printlnYour select EXIT.;
else
System.out.printlnInvalid option;
Question: Convert the above ifelse..if STATEMENT into a SWITCH STATEMENT
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