What would be the value of discountRate after the following statements are executed?
Double discountRate = 0.0;
Int purchase = 1250;
Char cust = 'N';
If (purchase > 1000)
If (cust == 'Y')
DiscountRate = .05;
Else
DiscountRate = .04;
Else if (purchase > 750)
If (cust == 'Y')
DiscountRate = .04;
Else
DiscountRate = .03;
Else
DiscountRate = 0;
A) .05
B) .04
C) .03
D) 0
Correct Answer:
Verified
Q6: Programs never need more than one path
Q34: This is a boolean variable that signals
Q35: What would be the value of x
Q36: These operators use two operands:
A) Unary
B) Binary
C)
Q37: What would be the value of discountRate
Q38: What is the value of x after
Q40: What is the value of ans after
Q41: Which of the following is the correct
Q42: The switch statement is a:
A) Multiple alternative
Q44: Because the && operator performs short-circuit evaluation,
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