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
vesna_86 [32]
3 years ago
10

A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost

of producing one liter of milk and the profit of each carton of milk vary from farm to farm. Write a program that prompts the user to enter: The total amount of milk produced in the morning. The cost of producing one liter of milk. The profit on each carton of milk. The program then outputs: The number of milk cartons needed to hold milk. Round your answer to the nearest integer. The cost of producing milk. The profit for producing milk.
Computers and Technology
1 answer:
makvit [3.9K]3 years ago
3 0

Answer:

milk_produced = float(input("Enter the total amount of milk produced in the morning: "))

liter_cost = float(input("Enter the cost of producing one liter of milk: "))

carton_profit = float(input("Enter the profit on each carton of milk: "))

carton_needed = round(milk_produced / 3.78)

cost = milk_produced * liter_cost

profit = carton_profit * carton_needed

print("The number of milk cartons needed to hold milk is " + str(carton_needed))

print("The cost of producing milk is " + str(cost))

print("The profit for producing milk is " + str(profit))

Explanation:

*The code is in Python.

Ask the user to enter milk_produced, liter_cost and carton_profit

Calculate the number of milk cartons needed, divide the milk_produced by the capacity (3.78) of a cartoon and round the result

Calculate the cost, multiply the milk_produced by liter_cost

Calculate the profit, multiply the carton_profit by carton_needed

Print the results

You might be interested in
Why did latex replace wax?
andrezito [222]

Answer:

Latex replaced wax because it did the same thing and was used for the same things that wax would be used for

Explanation:

3 0
3 years ago
Write a program to calculate the area of a triangle whose base is 10cm and height is 6cm
Tcecarenko [31]

Answer:

30cm

Explanation:

Height X Base

6cm X 10cm

60cm

Then take half because a triangle is half a square and we are using a square formula.

60cm divided by 2

=30cm

7 0
2 years ago
When you open a browser window, it open in a _____. <br> a. fieldb. folderc. menud. window?
Romashka [77]
D. A window the rest are incorrect
4 0
3 years ago
A Uniform Resource Locator (URL) consists of three separate parts: network protocol, host, and web browser.
FrozenT [24]
That is false. are you doing it on a computer course.                                             <span />
3 0
3 years ago
Read 2 more answers
Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus
SVETLANKA909090 [29]

Answer:

B) A block of statement that might cause an exception.

Explanation:

Exception handling is a good programming technique that prevents our program from crashing when an exception occurs during execution. The try clause is used with a catch to handle any exception that might occur, so whenever a statement that might cause an exception is to be used, this should be contained in a try statement block of code.

5 0
3 years ago
Other questions:
  • Put the following five steps in the order in which you would perform them to use the Paste Special function: ____. 1. Select and
    5·1 answer
  • In an advanced word processing program which type of image or graphic is available in a variety of formats and styles?
    12·2 answers
  • How to make your keyboard sound like a piano?
    9·1 answer
  • Um can anyone who is really into science and physics answer this question
    7·1 answer
  • You are evaluating the bounce rate of your overall website traffic and find that users with a social media referral source have
    9·1 answer
  • The Status bar is used to control the majority of the drafting settings in AutoCAD
    13·1 answer
  • Sandra is having difficulty with her reading assignment because she does not fully understand the language. Which online tool wo
    6·1 answer
  • customer seeks to buy a new computer for private use at home. The customer primarily needs the computer to use the Microsoft Pow
    5·1 answer
  • The ______ engine compares your entry against its database and returns a list of hits or sites that contain the keywords. (hint:
    8·1 answer
  • T/F static development is the process of constructing the programs and code modules that serve as the building blocks of the inf
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!