Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
