Multiple Choice
Assuming that the user inputs a value of 25 for the price and 10 for the discount rate in the following code snippet, what is the output?
Public static void main(String[] args)
{
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.println("The new price is " +
Price - price * (discount / 100.0) ) ;
}
A) The new price is 25
B) The new price is 15
C) The new price is 22.5
D) The new price is 20.0
Correct Answer:

Verified
Correct Answer:
Verified
Q17: At what point in the problem-solving process
Q34: Which one of the following types of
Q34: Consider the following division statements:<br>I.22 / 7<br>II.22.0
Q37: Which of the given statements generates the
Q50: Which one of the following statements gives
Q66: Consider the following Java variable names:<br>I.1stInstance<br>II.basicInt%<br>III.empName_<br>IV.addressLine1<br>V.DISCOUNT<br>Which of
Q78: What does the following statement sequence print
Q80: What is wrong with the following code
Q95: Given the definition final double PI
Q101: What is the meaning of x =