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
Joe is a part of a team where the members come from various cultures and have different perspectives and viewpoints. What does J
Mamont248 [21]

Answer:

various cultures of the world.

Explanation:

You need to understand the cultures of the world, to work in a multinational company. Undoubtedly, you need to understand that the employees working in multinational companies are from various cultures, and they think differently as well. You need to understand them, and only then you can make them your friend and finally work together with full cooperation to ensure the best work. And for your success as well as the success of the company this is important.

6 0
3 years ago
The following method is intended to remove all values from the ArrayList a that have the same value as val; however, this method
Alona [7]

Answer:

ArrayList a contains [2, 3, 3, 3, 4, 5, 3, 2, 1]

Explanation:

Given

The removeValue method

Required

The content of ArrayList a, after the method is called

From the question, we understand that arraylist a is:

a= [2, 3, 4, 3, 3, 4, 4, 5, 4, 3, 2, 1]

val =4

The function fails when the value to be removed appear consecutively in the list.

4 appears in index 5 and 6 of the list. Only one of the 4's will be removed

So, the updated list will be: [2, 3, 3, 3, 4, 5, 3, 2, 1]

6 0
3 years ago
Adding transitions to slides in a presentation.
8090 [49]

B.) The addition of slide transitions

4 0
4 years ago
Read 2 more answers
I neeeeed a girl that is looking for true love, trust me i will love her
nignag [31]

Answer:

sure!

Explanation:

4 0
3 years ago
Read 2 more answers
A type of sensor used to detect which way around a device is being held. ​
Marta_Voda [28]
There’s 3 main ones accelerometer, gyroscope, and magnetometer.
8 0
3 years ago
Other questions:
  • What does hdtv stand for
    7·2 answers
  • Which innovation allowed for the mass production of goods? A. Cotton gin B. Sewing machine C. Industrial lubricator D. Interchan
    6·1 answer
  • Assure that major, minor, sub1 and sub2 each contain four digit numbersIf less than four digits are entered in major OR minor OR
    5·1 answer
  • When a typist changes from a conventional typewriter to a word processor, his typing schema will have to _____ to incorporate th
    12·1 answer
  • 286795991 número pra convidar no tiktok​
    11·2 answers
  • People with healthy media diets:
    12·1 answer
  • Which lighting technique can often heighten a dramatic story?
    14·1 answer
  • jeff has just upgraded from windows 7 to windows 10 and he is confused. He has started several universal apps but he can't figur
    11·1 answer
  • Explain the characteristics of 1st generation computers​
    15·1 answer
  • Which of the following is the system of rules and structure governing
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!