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
Eugene wants to indent a paragraph, but the ruler is not present. Which tabs could Eugene use in order to accomplish his goal?
Anton [14]
He could either use the tab key to indent, if you want to make the ruler visible, you can go to the view tab and click the check mark next to show ruler.
8 0
3 years ago
Read 2 more answers
What type of traffic always goes to all devices in a subnet?
zmey [24]
There are three types of traffic in an IP network:
1. Unicast -  one-to-one traffic (traffic from one sender to one receiver) 
2. Multicast - one to many traffic (one sender and more receivers) 
3.Broadcast -  every device in the network will receive the packet
So, the broadcast traffic <span>always goes to all devices in a subnet. </span>
6 0
3 years ago
One of the jobs of the webmaster are to create a website<br>true or false
Talja [164]

true is the correct answer

8 0
3 years ago
Read 2 more answers
Which is a way that computer simulations of medicines could help reduce ethical issues in drug research? computer simulations co
Marat540 [252]
Computer simulations could reduce the need for testing on animals.
3 0
3 years ago
How can you quickly access the desktop when you have many applications open.
murzikaleks [220]

Answer:

Clear all your cookies and browing data or delete the tabs that u have or do a clean up of your desktop every once in a while it say it will clean my laptop so it throw out all the trash stuff that is in it so baiscally it mean that it'll reset it.

4 0
2 years ago
Other questions:
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • when seeking information on the on the internet about a variety of subjects the most useful place to look would be?
    13·1 answer
  • Objects of the calculator class require no additional information when created. define an object named calc, of type calculator.
    14·2 answers
  • Which is an advantage that electronic scheduling tools have over paper calendars?
    13·2 answers
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    15·1 answer
  • What does it mean if my ninja blender power light is blinking?
    13·2 answers
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • How to tell if your phone is being monitored
    12·1 answer
  • For which tasks is Layout view most helpful? Check all that apply.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!