• Register
0 votes
36 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

7 5 3
5,380 points

Please log in or register to answer this question.

2 Answers

0 votes

Solutions:

Let me try to help you with your query.
Answer is - .04
  
Hope this might help you.
 
8 6 2
10,530 points
0 votes

Solution:

The Correct Answer of this question is A) .04

10 6 4
31,120 points

Related questions

0 votes
1 answer 108 views
108 views
Problems: What will be the value of x after the following code is executed? int x, y = 4, z = 6; x = (y++) * (++z); A) 24 B) 28 C) 30 D) 35 I am new to programming , Can anyone help me ?
asked Feb 13, 2020 maddi86 5.4k points
0 votes
1 answer 46 views
46 views
Problem: What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; } A) 90 B) 110 C) 210 D) This is an infinite loop.
asked Mar 9, 2020 ArifulIslam 7.5k points
0 votes
1 answer 161 views
161 views
Problem: I am new in programming and when running below code getting some unexpected error, can anyone help me with right result after running this code? Given the following code, what will be the value of finalAmount when it is displayed? public class Order { ... getOrderAmount() - order.getOrderAmount() * order.getOrderDisc(); System.out.println("Final order amount = $" + finalAmount); } }
asked Feb 18, 2020 maddi86 5.4k points
0 votes
0 answers 9 views
9 views
Problem: Which of the following would not be considered a database data type? SELECT MODIFY DELETE ALL of the above
asked Jul 21, 2020 kTyson 14.6k points
0 votes
2 answers 111 views
111 views
Problem: Which of the following would not be considered an operating system resource?​ a. ​RAM b. ​CPU c. Storage d. All of the above
asked Mar 9, 2020 ArifulIslam 7.5k points
0 votes
1 answer 86 views
86 views
Problem: Can anyone guide me with the right solution? Which of the following would be considered a host? A CDROM The computer&rsquo;s hard drive A network cable A printer attached to the network via an IP address
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 93 views
93 views
Problem: Can anyone guide me with the right solution? Which of the following would NOT be a benefit of networking computers? a. Sharing printers and other peripherals. b. Sharing files. c. Sharing an Internet connection. d. Sharing software licenses.
asked Feb 17, 2020 maddi86 5.4k points
0 votes
1 answer 21 views
21 views
Problems: Can anyone give the right solution? In which of the following situations would restoring from a backup be the best option? (Select Two.) A. You need to restore several word processing files that were accidentally deleted from My Documents. B. You recently ... a new application and now the system behaves erratically. E. You need to restore a Windows system after a hard drive failure.
asked Feb 14, 2020 maddi86 5.4k points
0 votes
2 answers 86 views
86 views
Problems: Can anyone guide me with the right answer? Which of the following would NOT be a benefit of networking computers?a. sharing printers and other peripherals b. sharing files c. sharing an Internet connection d. sharing software licenses
asked Feb 13, 2020 maddi86 5.4k points