1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alina1380 [7]
3 years ago
11

What would be the value of discountRate after the following statements are executed? double discountRate = 0.0; int purchase = 1

250; if (purchase > 1000) discountRate = .05; if (purchase > 750) discountRate = .03; if (purchase < 2500) discountRate = .01; else discountRate = 0;
Computers and Technology
1 answer:
Karolina [17]3 years ago
4 0

Answer:

The value of discountRate would be 0.01

Explanation:

double discountRate = 0.0;

     int purchase = 1250;

     if (purchase > 1000)

     discountRate = .05;

     if (purchase > 750)

     discountRate = .03;

     if (purchase < 2500)

     discountRate = .01;

     else discountRate = 0;

discountRate is declared as 0.0 then purchase is 1250. But the entire if statement is sequential, that is; all the if statement are executed.

first if-statement assign .05 to discountRate because purchase is greater than 1000.

Next if-statement re-assign .03 to discountRate because purchase is greater than 750.

The last if-statement re-assign .01 to dicountRate because purchase is less than 2500. Since this is the last if statement executed, the value of discountRate is .01

You might be interested in
If u had a virus and u didn’t know how must damage will there be and how long will it take for you to notice?
Dimas [21]

<u>The Virus:</u>

A virus can be defined as a malicious program, that breaks into the computer without the consent of the user and sometimes even without the knowledge of the user. Viruses are also of different types and categories.

There are certain kinds of malware and spyware that enter a computer and start encrypting the user's data. Generally, a user gets to know about the existence of a virus when the computer programs begin to misbehave. Some files get corrupted and the user can't access them anymore.

Some files and programs may also get deleted as if they weren't even present on the system. But in case someone has installed good anti-virus software, they will get a notification as soon as some file containing some kind of virus enters the computer.

7 0
3 years ago
Reserve space in memory for a variable called UIN of size word. The initial value of UIN will be the sum of the digits in your U
sladkih [1.3K]

Answer:

Explanation:

See the attached picture for answer.

4 0
3 years ago
Which from the following list are an example of productivity software?
Scorpion4ik [409]
D. All of the Above.....
3 0
4 years ago
Read 2 more answers
What country threatens Denmark at the beginning of Hamlet as evidenced in Marcellus’s question, "Why this same strict and most o
Ghella [55]

Answer: Norway is threatening Denmark

Explanation: Marcellus’s country is threatened with invasion by Norway as evidenced by Marcellus questions as to why Denmark is feverishly preparing for war.

6 0
4 years ago
What plugs into this?
vfiekz [6]
Into what ????????????

4 0
2 years ago
Read 2 more answers
Other questions:
  • Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
    11·1 answer
  • What is difference between RAM and ROM?
    13·1 answer
  • What does sustainable mean<br>​
    7·1 answer
  • Because of Moore's Law, widely-used encryption programs currently employed by banks and ecommerce sites are now easily penetrate
    11·1 answer
  • Because the data was formatted the same in two inventory files, you decided to combine their contents into one file. Now you wan
    7·1 answer
  • The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
    10·1 answer
  • What was the original motivation for developing the internet?
    7·1 answer
  • Cookies Are Us runs a series of 100 cookie stores across the Midwestern United States and central Canada. At the end of each day
    13·1 answer
  • How can you make your MakeCode micro:bit program display either the letter<br> A or the letter B?
    11·1 answer
  • Can anyone please give examples of pseudocode in programming? Thanks you very much!
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!