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
ICE Princess25 [194]
3 years ago
14

Write a program that uses a custom function to return the cost of purchasing an item, possibly in multiple quantities. The item

might be subject to 7% sales tax. The main function should prompt the user to enter the quantity, unit price, and taxable data. The main function should call the custom function with these three inputs as arguments and print the cost of the purchase in currency format.
Computers and Technology
1 answer:
alexandr402 [8]3 years ago
3 0

Answer:

def cost(quantity, unit_price, taxable):

   if taxable == "Yes":

       total = (quantity * unit_price) + (quantity * unit_price * 0.07)

   elif taxable == "No":

       total = quantity * unit_price

   return total

q = int(input("Enter the quantity: "))

p = float(input("Enter the unit price: "))

t = input("Is %7 tax applicable? (Yes/No): ")

print(str("$" + str(cost(q, p, t))))

Explanation:

- Create a function called cost that takes three parameters, quantity, unit price, and taxable

- If the tax is applicable, calculate the total with tax. Otherwise, do not add the tax.

- Return the total

- Ask the user for the inputs

- Call the function with given inputs and print the result

You might be interested in
Acess labeling windows​
Debora [2.8K]

Answer:

I got the same thing

Explanation:

8 0
3 years ago
Comments can be compared to a virtual _____.
Vladimir79 [104]
What's the rest of the question? Like A - B - C - D?
3 0
3 years ago
Question 3 / 5
Andrej [43]

Answer:

False

Explanation:

3 0
3 years ago
Which of the following is least likely to be a scientific experiment?
enot [183]
It would be the last one, because she isn't recording any type of data over what she is doing and she isn't observing it at all. She simply trimmed the stems of a bouquet of flowers. However, the other options insist that they are recording data and observing, like you would do when performing an experiment. I hope this helps! :)
8 0
3 years ago
Read 2 more answers
HELPPPPPPP!!!!!!!!!
Andrei [34K]
The compression ratio is 20:1 please mark me brainliest
3 0
3 years ago
Other questions:
  • In order to be compliant with the NIST publications, policies must include key security control requirements. One of these key r
    10·1 answer
  • Which measure should you take for the periodic maintenance of your computer?
    15·2 answers
  • How do ethics affect people?
    15·1 answer
  • The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that integrates the inf
    14·1 answer
  • The INC and Dec instruction do not effect the__________ flag
    6·1 answer
  • doubleIt is a function that takes one argument and returns no value . The argument is a pointer to int . The function doubles th
    9·1 answer
  • True/False
    13·1 answer
  • The best way to help prevent a system from a worm attack is to use anti-virus software anti-malware software a firewall a router
    12·1 answer
  • I have a problem with my Nintendo DS lite does anyone know how to fix it?
    8·1 answer
  • Davingould1115...................answer 3​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!