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
Q6: What is wrong with the following code
Q8: ) What are the values of num1
Q9: What is wrong with the following code?
Int
Q10: Which of the following guidelines will make
Q12: What is the output of the following
Q13: Which of the following statements with comments
Q14: What is wrong with the following code
Q16: What is the output of the following
Q49: What is the value of Math.pow(3, 2)?
A)6.0
B)9.0
C)8.0
D)5.0
Q54: Which one of the following operators computes
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents