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
Which teamwork characteristic motivates your team members to perform better?
scoundrel [369]
Maybe Encouragement? I don't know, are there any choices to choose from?
4 0
3 years ago
Read 2 more answers
Name two features that would be useful to potential customers
Dmitry [639]

Answer:

  1. How your business is unique
  2. A clear sense of what your company offers

Explanation:

Respond the subject "Who are you and What your business represents?" as interestingly and compellingly as feasible. This involves recording administration bios that state your expertise, times of struggle and various different qualities or details that may make you special from others.

"It's unbelievable how many businesses you visit and you're unsure something the organization offers". Execute it a superiority on your homepage to present at least comprehensive information regarding your outcomes and/or co-operation.

6 0
3 years ago
When you declare a variable of a basic, primitive type, such as int x = 10;, the memory address where x is located holds the ___
Nadya [2.5K]

Answer:

Answer is (d) value of 10

Explanation:

Usually when we write "int x=10;", a memory space is allocated for an integer variable with name x, and content 10.

8 0
3 years ago
Read 2 more answers
What are two composite numbers that both have 8 as a factor?
Vinvika [58]
A composite number is a number that can be divided by a number other than one and itself.
Composite numbers with 8 as a factor:
16, 24, 32, 40, 48.
Choose two of the numbers.
6 0
3 years ago
An array can store integers and doubles together.true or false
Anna [14]

Answer:

False

Explanation:

An array stores a sequence of values that are all of the same type

7 0
3 years ago
Other questions:
  • Modern database tools support ________________, which entails separating data from the programs that manipulate data.
    14·1 answer
  • If you were to create a new app for a smartphone or tablet that does not already exist, what would you create?
    10·1 answer
  • I can't find the errors! Could anyone help me please?!
    5·1 answer
  • What is conference proceeding​
    10·2 answers
  • Which line of code will only allow a symbol to be stored in a variable?
    11·2 answers
  • What does a computer need from people in order to solve problems effectively?
    9·1 answer
  • How do you resolve conflicts in your life??
    11·1 answer
  • Help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!​
    9·1 answer
  • A good algorithm should have which three components?
    10·1 answer
  • Write a program that prompts the user for two numbers then outputs the result of dividing the first number by the second number
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!