MissSmartyPants625 MissSmartyPants625
  • 14-09-2020
  • Computers and Technology
contestada

Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

Respuesta :

frknkrtrn
frknkrtrn frknkrtrn
  • 18-09-2020

Answer:

subtotal = float(input("Subtotal: "))

gratuity_rate = float(input("Gratuity Rate: "))

gratuity = subtotal * gratuity_rate / 100

total = subtotal + gratuity

print("Gratuity is $" + str(gratuity))

print("Total is $" + str(total))

Explanation:

*The code is in Python.

Ask the user to enter subtotal and gratuity_rate

Calculate the gratuity, multiply subtotal and gratuity_rate and divide the result by 100

Calculate the total, sum the subtotal and gratuity

Print the gratuity and total

Answer Link

Otras preguntas

~ALGEBRA! PLEASE HELP!~ Austin is climbing on a ladder that is attached against the side of a jungle gym wall. He is 5 feet off the ground and 3 feet horizontal
Researchers performing __________ insert a weak electric current into the brain to stimulate it. A. lesioning B. ESB C. EEG
I have no idea how to use this site yet, so I'm just gonna put my algebra problem here. Thanks for any help! Graph system of equation: x-2y=2 3+y=6
What is a gene? A. a section of a protein that codes for DNA B. the alternate version of a trait C. the visible trait in the F1 generation D. a section of D
PLEASE HELP I GIVE THANKS
Please help me with this question (5y + 2)2 − 96 = 0
Which team was the first to win the Super Bowl as a wild card?
what is 78% of 50 questions
What kind of cell has a large, central, vacuole
how do i get group B strep?