What would be the value of discountRate after the following statements are executed?
Double discountRate = 0.0;
Int purchase = 100;
If (purchase > 1000)
DiscountRate = 0.05;
Else if (purchase > 750)
DiscountRate = 0.03;
Else if (purchase > 500)
DiscountRate = 0.01;
A) 0.0
B) 0.05
C) 0.03
D) 0.01
Correct Answer:
Verified
Q3: _ operators are used to determine whether
Q4: If str1 and str2 are both String
Q7: Which of the following expressions could be
Q9: What is the value of ans after
Q10: What will be displayed when the following
Q12: What will be displayed when the following
Q14: What would be the value of x
Q15: What will be the value of bonus
Q16: In an if-else statement, if the boolean
Q29: The boolean expression in an if statement
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