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
A small company with 100 computers has hired you to install a local area network. All of the users perform functions like email,
charle [14.2K]

Answer:

Answer to the following question is as follows;

Explanation:

Windows 7 for 100 users and Windows 8.1 for 25 users are the best options since they both enable networking and active directory, and Windows 8.1 also offers Windows server capabilities.

Winxp would therefore work for $100, but it is unsupported and has no updates.

If you wish to go with open source, you can choose Ubuntu 16 or 18 or Linux.

8 0
3 years ago
Difference between customized and packaged software​
docker41 [41]

Packaged software is a compilation of programs which are grouped together in order to provide publicly with different tools in the same group.

Custom software is a specific program that are advanced for a goal in a department or in a company.

5 0
3 years ago
Which of the following is an example of a tax?
Alik [6]
Medicare because it’s like insurance
5 0
3 years ago
20 points!!!!! Plz answer quickly
Elena L [17]

Answer:

other words are not clear

3 0
3 years ago
How to transfer photos from iphone to iphone?
STALIN [3.7K]
If you have icloud then you can transfer them.
7 0
3 years ago
Read 2 more answers
Other questions:
  • 3. The invention of the transistor was important to the development of computers because it
    5·1 answer
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    15·1 answer
  • 1.How does inertia affect a person who is not wearing a seatbelt during a collision?
    10·1 answer
  • What are the two basic classes of active directory objects?
    14·1 answer
  • A label control may be added to a form by double-clicking on the Label control icon in the ________ window.
    15·1 answer
  • What is the largest place value in a 12 bit binary number?
    10·1 answer
  • Choose all that apply.
    11·1 answer
  • What necessarily happens when a photographer chooses to give either the aperture or the shutter speed priority?
    10·1 answer
  • Whenever you press a key, click the mouse or start an application, you're sending instructions tow
    9·1 answer
  • What is the missing line of code?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!