Question: Java o n the nested if-else structure below, answer questions 12 and 13 if (a ) if (b 5) else XX+ 3; else 12) if

 Java o n the nested if-else structure below, answer questions 12
Java

o n the nested if-else structure below, answer questions 12 and 13 if (a ) if (b 5) else XX+ 3; else 12) if x is currently 0 a 5 and b 5, what will become after the above statement is ex b) 2 c) 3 e) 5 13) if x is currently o, a = 0 and b = -5, what will become after the above statement is executed? alo b) 2 c) 3 d) 4 e) 5 14) Consider the following snippet of code: Random generator = new Random: int rand Num = generator.nextInt(20)+1; Which of the following will be true after these lines are executed? a) randNum will hold a number between 1 and 20 inclusive. b) randNum will hold a number between 0 and 20 inclusive. c) randNum will hold a number between 1 and 21 inclusive. d) these lines will not be executed because a compiler error will result e) none of the above 15) Which of the following represents the proper way to create a NumberFormat object that formats numbers as percentages? a) NumberFormat fmt = new NumberFormat(%); b) Number Format fmt= new NumberFormat("%"); c) Number Format fmt Number Format.getPercentinstance(): d) NumberFormat fmt= new PercentNumberFormat(); e) none of the above 16) Fruit is an enumerated type with values apple, banana, grape, and orange, in that order. Which of the following statements assigns the value orange to the Fruit variable snack? a) snack = orange; b) Fruitsnack #orange; c) snack Fruit.orange; d) snack Fruitlast(): c) snack Fruit(4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!