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
Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout &lt;&lt; fixed
Fofino [41]

Answer:

In C++:

#include <iomanip>

#include <iostream>

#include <vector>

using namespace std;

int main(){

vector<double> myvector;

double userinput;

cout<<"Enter 5 numbers: ";

for (int i = 1; i <= 5; i++){

 cin>>userinput;

    myvector.push_back(userinput);

}

for (int i = 0; i < 5; i++){

    cout << fixed << setprecision(2)<< myvector.at(i) <<' ';

}

return 0;

}

Explanation:

This declares the vector as double

 vector<double> myvector;

This declares a variable for input as double

double userinput;

This prompts the user for input of 5 numbers

cout<<"Enter 5 numbers: ";

This iterates from 1 to 5

for (int i = 1; i <= 5; i++){

This gets each integer input

 cin>>userinput;

This pushes each input into the vector

    myvector.push_back(userinput); }

This iterates through the vector

for (int i = 0; i < 5; i++){

This prints each vector element separated by space using fixed setprecision

cout << fixed << setprecision(2)<< myvector.at(i) <<' ';

}

5 0
2 years ago
An administrator has been asked to update a flow that was created as part of a recent update. When the administrator opens the f
Luba_88 [7]

There are steps to take so as to update a flow that was created as part in recent update. What would cause the said action is that  the flow Is a before save flow.

<h3>What is a flow</h3><h3 />
  • A flow in this scenario is known to makes before-save updates and it is known to be quite similar to a before trigger.

The Before-save Flow is known to be a trigger that is done before a given operation.

See full question below

An administrator has been asked to update a flow that was created as part of a recent update. When the administrator opens the flow for edtting, the Flow Bunder toolbox offers only four elements: Assignment, Decision, Get Records, and Loop.

What would cause this?

A . The flow Is a before save flow.

B . The flow Is a screen flow.

C . The version of the flow is activate.

D . The version of the flow is inactive.

Learn more about Flow from

brainly.com/question/6532130

4 0
2 years ago
Which type of virus includes protective code that prevents outside examination of critical elements?
Vlad1618 [11]

Answer:

Armoured viruses

Explanation:

Armoured viruses are computer viruses that have been found to be very dangerous, Armoured viruses ar designed to protect itself against any attempt to detect or trace Its activities. They have different ways through which they bypass antivirus software applications in a computer system, making it very difficult to eliminate from an infected system.

5 0
3 years ago
How did transistors revolutionize the world of computers?
Marizza181 [45]

Answer:

Transistors transformed the world of electronics and had a huge impact on computer design. Transistors made of semiconductors replaced tubes in the construction of computers. By replacing bulky and unreliable vacuum tubes with transistors, computers could now perform the same functions, using less power and space.

3 0
3 years ago
Which internet explorer security feature restricts the browsing session information that can be tracked by external third-party
Anarel [89]

Tracking protection internet explorer security feature restricts the browsing session information that can be tracked by external third-party websites and applications

The internet can be a dangerous place, and it's important to take steps to protect your privacy. One way to do this is to enable tracking protection in your web browser.

Tracking protection is a security feature that restricts the information that can be tracked by external websites and applications. This means that your browsing session will be more private, and your data will be less likely to be collected and used without your consent.

To enable tracking protection in Internet Explorer, go to the Tools menu and select Internet Options. On the Privacy tab, click the Tracking Protection button. You can then choose to enable tracking protection for all websites, or only for certain websites that you trust.

Enabling tracking protection can help to keep your data safe and your privacy protected. So if you're concerned about online privacy, be sure to enable this feature in your web browser.

Learn more on internet explorer here:

brainly.com/question/28431103

#SPJ4

6 0
1 year ago
Other questions:
  • How do you increase the amount of data in a sampled Google Analytics report?
    8·1 answer
  • Janice, who is 15, posts a picture of herself drinking alcohol and making an obscene gesture on her social networking page. Whic
    11·2 answers
  • What is the part of the browser window that displays the content of the web page such as pictures and text called?
    10·1 answer
  • Which statement best compares routers and hubs?
    9·1 answer
  • Given a constant named size with a value of 5, which statement can you use to define and initialize an array of doubles named ga
    12·1 answer
  • Question No. 5:
    7·1 answer
  • Write a small program that takes in two numbers from the user. Using an if statement and an else statement, compare them and tel
    12·1 answer
  • If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
    12·1 answer
  • In your own words, what is Cryptocurrency?
    15·2 answers
  • Describe the specific job you would want to have if you were going to pursue a career in digital music or video.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!