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
ollegr [7]
4 years ago
14

The Maui coffee shop sells coffee at $10.50 a pound plus the cost of shipping. Each order ships for $0.86 per pound + $1.50 fixe

d cost for overhead. Write a program that calculates the cost of an order. Get input from the user, calculate the cost, and display the output. using functions.
Computers and Technology
1 answer:
Rainbow [258]4 years ago
7 0

Answer:

  1. def calculateOrder():
  2.    pound = float(input("Enter number of pound ordered: "))
  3.    COST_PER_POUND = 10.5
  4.    SHIP_PER_POUND = 0.86
  5.    OVERHEAD = 1.5
  6.    shipping = SHIP_PER_POUND * pound  
  7.    total_cost = pound * COST_PER_POUND + shipping + OVERHEAD  
  8.    print("Total cost: $" + str(total_cost))
  9. calculateOrder()

Explanation:

The solution code is written in Python 3.

Firstly we declare a function calculateOrder (Line 1). Next we use input function to prompt user to enter the number of pound of coffee they wish to order (Line 2). Create three constant variables to hold the value of cost per pound, shipping fee per pound and the overhead charge (Line 3-5). We first calculate the shipping charge (Line 6) and then adding the shipping charge along with the cost for coffee ordered and the overhead charge (Line 7). Lastly, print the total cost (Line 8).

We test the function (Line 10).

You might be interested in
Offering 20 points for this iCloud related question!
Bezzdna [24]
1. Factory Reset
2. Jailbreak
3. To delete iCloud you need to turn of find my iphone
8 0
3 years ago
How can u get this off us keybored chromme book
WITCHER [35]
Click the icon at the bottom of the screen that says “US” it should go away
5 0
4 years ago
Re write the program below and correct all the errors
Serggg [28]

one = 1

two = 2

three = 3

four = one + 3

print(four)

hello = "hello"

world = "world"

helloWorld = hello + " " + world

print(helloWorld)

7 0
3 years ago
Deep water can ____.
Hoochie [10]
D. Stall your vehicle
5 0
3 years ago
Read 2 more answers
Which example best describes a school consequence for committing plagiarism?
sergij07 [2.7K]

Answer:

1

Explanation:

6 0
4 years ago
Other questions:
  • Radio waves pros and cons
    10·2 answers
  • You are starting a spreadsheet, and you would like 500 to appear in cell C3. You should _____.
    11·2 answers
  • What two factors make up the skills of a good typist
    6·1 answer
  • The original commercial version of Ethernet supported 10 Mbps bandwidth; the version introduced in the early 1990s supports 100
    13·1 answer
  • What is the simplest way to permanently get rid of an unwanted file on the computer
    9·1 answer
  • Write a function index(elem, seq) that takes as inputs an element elem and a sequence seq and returns the index of the first occ
    7·1 answer
  • Consider a disk with the following characteristics (these are not parameters of any particular disk unit): block size B 512 byte
    8·1 answer
  • You enjoy helping people find solutions to problems that they are having with technology. Which job might be best for you?
    6·1 answer
  • Which of the following is adoptable in Mindanao only?​
    5·1 answer
  • 1. Who is affected by electronic theft of a song?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!