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
Write a loop that reads strings from standard input where the string is either "land", "air", or "water". The loop terminates wh
____ [38]

Answer:

count_land = count_air = count_water = 0

while True:

   s = input("Enter a string: ")

   if s == "xxxxx":

       break

   else:

       if s == "land":

           count_land += 1

       elif s == "air":

           count_air += 1

       elif s == "water":

           count_water += 1

print("land: " + str(count_land))

print("air: " + str(count_air))

print("water: " + str(count_water))

Explanation:

*The code is in Python

Initialize the variables

Create a while loop that iterates until a specific condition is met. Inside the loop, ask the user to enter the string. If it is "xxxxx", stop the loop. Otherwise, check if it is "land", "air", or "water". If it is one of the given strings, increment its counter by 1

When the loop is done, print the number of strings entered in the required format

4 0
3 years ago
Executives of a company deal less with details of the operational activities and deal more with the higher meaningful aggregatio
mylen [45]

Answer:

3. Granularity

Explanation:

Granularity's concept is representing the level of how do we store the data in our database.

If the data are detailed, we can resume the data until get a granularity more strong for our analysis.

For example:

We could store data year by year of our costumers, if want to get more granularity, we could store data month by month, also we could get specific data like how often our customers visit the business or how often our customers buy in a category product.

4 0
3 years ago
With "read" function, which one of the following statements is NOT correct? a.If the read is successful, the number of bytes rea
worty [1.4K]

Answer:

a. If the read is successful, the number of bytes read is returned.

b. If the end of file is encountered, 0 is returned.

Explanation:

A read function is one of the functions used in computer programming. A read function is used to read an information or data that was written before into a file.

If any portion of a regular file before to the end of file has not been written and the end of file is encountered the read function will return the bytes with value 0.

If read function has read some data successfully, it returns the number of bytes it read.

3 0
3 years ago
The Internet Protocol Suite consists of the Internet Protocol and _____. a. Transmission Control Protocol b. File Transfer Proto
Lesechka [4]

The Internet Protocol Suite consists of the Internet Protocol and Transmission Control Protocol. Then the correct option is A.

<h3>What are Internet Protocol and Transmission Control Protocol?</h3>

Transmission Control Protocol/Internet Protocol (TCP/IP) is a set of communication protocols that are used to link network devices on the internet.

In a personal computer network, TCP/IP is often used as a wireless signal.

The IP suite's two major protocols have distinct roles. TCP specifies how apps might establish channels across a network.

More about the Internet Protocol and Transmission Control Protocol link is given below.

brainly.com/question/20813972

#SPJ1

6 0
2 years ago
Read 2 more answers
A large gambling company needs to be able to accept high volumes of customer wagers within short timeframes for high-profile spo
Dima020 [189]

Answer: A. a mobile app that only accepts wagers based on the user's location

Explanation:

Elastic cloud simply refers to the cloud computing offering which due to the need for change helps in the provision of variable service levels.

Based on the information given in the question, an effective elastic Cloud solution that can meet this client’s needs is a mobile app that only accepts wagers based on the user's location.

Since there are strict laws that prohibit gambling activities outside the licensed zones, the user location is vital in the mobile app.

5 0
3 years ago
Other questions:
  • What does computer means?
    13·2 answers
  • How can a wiki contribute to an academic paper?
    9·2 answers
  • What is a expansion card for computer?
    5·1 answer
  • Service that connects on-premises software appliances with cloud based storage is ______
    10·1 answer
  • Nathan wants to create multiple worksheet containing common formatting styles for his team members. Which file extension helps h
    9·1 answer
  • The sum of the elements of an integer-valued array recursively calculated as follows: The sum of an array of size 0 is 0; Otherw
    15·1 answer
  • Use the Windows ________ to check on a nonresponsive program. Select one: A. Backup utility B. Task Manager C. System Restore D.
    10·1 answer
  • True or False? Using your traffic analytics report, you can see the source of traffic to your website
    13·1 answer
  • Pls help have absolutely no clue how to delete this
    12·2 answers
  • Decrypt this secret message if your able to a lot will come..
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!