Multiple Choice
Assuming that the user inputs a value of 30 for the price and 10 for the discount rate in the following code snippet, what is the output? Scanner in = new Scanner(System.in) ;
System.out.print("Enter the price: ") ;
Double price = in.nextDouble() ;
System.out.print("Enter the discount rate: ") ;
Double discount = in.nextDouble() ;
System.out.print("The new price is ") ;
System.out.println(price - price * (discount / 100.0) ) ;
A) The new price is 30.0
B) The new price is 20.0
C) The new price is 27.0
D) The new price is 33.0
Correct Answer:

Verified
Correct Answer:
Verified
Q7: Assume the following variable has been declared
Q30: What is result of evaluating the following
Q31: What does the following statement sequence print
Q33: What is wrong with the following code?<br>Int
Q34: Which one of the following types of
Q34: Consider the following division statements:<br>I.22 / 7<br>II.22.0
Q37: What is wrong with the following code
Q38: What will be printed by the statements
Q101: What is the meaning of x =
Q121: What is the value of the following