• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
8 views

Problems:

I am new to programming, I need help, can anyone help me?
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) .04

b) .03

c) .05

d) 0

by (5.4k points)  

1 Answer

0 votes

Solutions:

Let me try to help you with your query.
Answer is - .04
  
Hope this might help you.
 
by (10.6k points)  
...