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
user100 [1]
3 years ago
7

Write a C function (NOT A COMPLETE PROGRAM) which uses the RETURNstatement to calculate and return the total cost for purchasing

books (quantity * bookcost). The parameter needed is the quantity of books wanted. If 20 or fewer books are wanted, then each book costs $23.45. If 21 to 100 books are wanted, then each book costs $21.11. If more than 100 books arewanted, then each book costs $18.75. Please assume that number of books passed to your function is positive.
Computers and Technology
1 answer:
stira [4]3 years ago
3 0

Answer:

int calculate_cost(int quantity) {

   double cost = 0;

   if (quantity <= 20)

       cost = quantity * 23.45;

   else if (quantity >= 21 && quantity <= 100)

       cost = quantity * 21.11;

   else if (quantity > 100)

       cost = quantity * 18.75;

   

   return cost;

}

Explanation:

Create a function called calculate_cost that takes one parameter, quantity

Initialize the cost as 0

Check the quantity using if else structure. Depending on the quantity passed, calculate the cost. For example, if the quantity is 10, the cost will be $234.5

Return the cost

You might be interested in
What is computer engineering?
posledela
Is was the engineering that been training to do the work for computer and technology.
3 0
3 years ago
. Describe a way to simplify a complex problem.
Inga [223]

Answer:

Simplify a complex problem means reduces its complexity and make it easy to understand. When we make the problem simplified then, the data become more clear and understandable.

There are many ways to simplify a complex problem as follows:

  • Organize the information and content properly and reduces the layers of complexity. Organized the content in the form of steps so that it become easy to understand.
  • Use of clear language is one of the most important part to make the content more clear and use proper formatting of the data.
  • Break the information into smaller parts to it can easy to read and looks more clearly. So, the reader finds it more comfortable and efficient.

5 0
3 years ago
For a certain company, the cost function for producing x items is C(x)=50x+100 and the revenue function for selling x items is R
solmaris [256]

Assuming that this company sells all that it produces, the profit function would be given by P(x) = -0.5(x - 100)² + 5,000 - 50x - 100.

<h3>What is profit?</h3>

In Economics, profit can be defined as a measure of the amount of money (revenue) that is generated when the selling price is deducted from the cost price of a good or service, which is usually provided by producers.

This ultimately implies that, all producers generally work to maximize their profits and make them as large as possible, in order to enable them break even and successful.

Mathematically, the profit function P(x) of a business firm simply refers to the revenue function R(x) minus the cost function C(x):

P(x) = R(x) - C(x)

Where:

  • R(x) represents how much it takes in.
  • C(x) represents how much it spends.

Substituting the given parameters into the formula, we have;

P(x) = -0.5(x - 100)² + 5,000 - (50x + 100)

P(x) = -0.5(x - 100)² + 5,000 - 50x - 100

Read more on maximized profit here: brainly.com/question/13800671

#SPJ1

7 0
2 years ago
Which course must first-time drivers in Florida take to be eligible for their Learner License?
Travka [436]
The Traffic Law and Substance Abuse Course (TLSAE), which is also known as the drug and alcohol course.
7 0
3 years ago
What is a cyber crime?<br><br>help
algol [13]

Answer:

cyber crime, also called computer crime, the use of a computer as an instrument to further illegal ends, such as committing fraud, trafficking in child p0®n0graphy and intellectual property, stealing identities, or violating privacy. Cyber crime, especially through the Internet, has grown in importance as the computer has become central to commerce, entertainment, and government.

3 0
3 years ago
Read 2 more answers
Other questions:
  • If a gas gosts 3.60 per gallon how much doe sit cost to drive 500 miles in the city
    5·1 answer
  • A _____________ is a method of controlled entry into a facility and provides access to secure areas such as a research lab or da
    10·1 answer
  • To prevent unauthorized access and use, at a minimum a company should have a written __________ that outlines the activities for
    6·1 answer
  • When preparing a document flowchart, the names of organizational departments or job functions should appear in theA) column head
    6·1 answer
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • Which company was the first to develop personal computers?
    6·1 answer
  • I need help about computer program. Solve C language code...... please​
    7·1 answer
  • Can a dod activity enter into a service contract for a military flight simulator without getting a waiver from the secretary of
    13·1 answer
  • if we intend to include a servo motor as an actuator, what feature should we include when selecting a microcontroller?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!