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
From the television industry's point of view, which of the following would be the most desirable viewer?
slava [35]
A 50-year-old African American man
4 0
3 years ago
Everyone’s favorite speedy blue hedgehog recently returned to his 2D origins in a critically acclaimed side-scrolling game. What
forsale [732]
It was called sonic mania
3 0
3 years ago
Read 2 more answers
Sorting Records in a Form
Naya [18.7K]

Answer:

1. Open the form in the standard form view.

2. Put the cursor in the field to use for sorting.

3. Open the Home tab

4. In the Sort & Filter group, click ascending or descending

Explanation:

Took the test :)

7 0
3 years ago
An error occured trying to answer a question on brainly. What should I do?
nikdorinn [45]

You should probably retry answering it. Or two people are already answering it.

-Edge

7 0
3 years ago
Read 2 more answers
The________ format is usually used to store data
Nikitich [7]
The answer is BCD; The BCD format is usually used to store data
5 0
3 years ago
Other questions:
  • 3. Of the following pieces of information in a document, for which would you most likely insert a mail merge field? A. First nam
    13·2 answers
  • Which of the following is true? A)Checks and Debit Cards both withdraw money directly from a bank account. B)Checks are the most
    13·2 answers
  • Which is an example of a student practicing ethical behavior online??
    7·2 answers
  • How to get out of compatibility mode in word?
    15·1 answer
  • The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
    15·1 answer
  • What are the purposes of a good web page design?
    9·2 answers
  • 01110101<br> +00100100<br> 00010001
    8·1 answer
  • What are the five generations of computers?​
    13·1 answer
  • A sensitive manufacturing facility has recently noticed an abnormal number of assembly-line robot failures. Upon intensive inves
    10·1 answer
  • Name any three areas of of application of excel.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!