Question

(COs 1 and 8) Create a Python program that calculates the tip and total for a...

(COs 1 and 8) Create a Python program that calculates the tip and total for a meal at a restaurant. Paste Python code here; output not required.

Sample output:

Tip Calculator

Enter cost of meal: 52.31

Enter tip percent: 20

Tip amount: 10.46

Total amount: 62.77


Specifications:
•Input: costOfMeal, tipPercent        

The formula for calculating the tip amount is:
tip = costOfMeal * (tipPercent / 100)
•         The program should accept decimal entries like 52.31 and 15.5.
•         Assume the user will enter valid data.
•         The program should round the results to a maximum of two decimal places.

-

-(CO 4 and 8) Create a Python program that will print every other number from 1 until the number that a user inputs. Paste Python code here; output not required.

Sample output:

Please enter the number to stop: 101

3

5

7

9

0 0
Add a comment Improve this question Transcribed image text
Answer #1

print("Tip Calculator")

costOfMeal = float(input("Enter cost of meal: "))

tipPercent = float(input("Enter tip percent: "))

tip = costOfMeal * (tipPercent / 100)

total = tip + costOfMeal

print("Tip amount:", round(tip, 2))

print("Total amount:", round(total, 2))

n = int(input("Please enter the number to stop: "))

for i in range(1, n+1):

if i % 2 == 1:

print(i)

Add a comment
Know the answer?
Add Answer to:
(COs 1 and 8) Create a Python program that calculates the tip and total for a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python Simple Programming Write a program in Python that calculates the tip and total for a...

    Python Simple Programming Write a program in Python that calculates the tip and total for a meal at a restaurant. When your program is run it should ... Calculate the tip and total for a meal for a restaurant Print the name of the application "Tip Calculator" Get input from the user for cost of meal and tip percent Print the tip and total amounts. The formula for calculating the tip amount is: tip = cost of meal * (tip...

  • Python Programming: Create a program that calculates three options for an appropriate tip to leave after...

    Python Programming: Create a program that calculates three options for an appropriate tip to leave after a meal at a restaurant and repeats if the user enters "y" or "Y" to continue. Print the name of the application "Tip Calculator" Get input from the user for "Cost of meal: " Calculate and display the "Tip Amount" and "Total Amount" at a tip_percent of 15%, 20%, and 25%. Use a FOR loop to iterate through the tip_percent The formula for calculating...

  • Language - PYTHON Design a program that calculates the total amount of a meal purchased at a restaurant

    Language - PYTHONDesign a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15% tip and 7% sales tax. Display each of these amounts and the total.Please help, I have no idea where to begin. Thanks

  • *Create in Python 3: Change Calculator Create a program that calculates the coins needed to make...

    *Create in Python 3: Change Calculator Create a program that calculates the coins needed to make change for the specified number of cents. Sample Console Output Change Calculator   Enter number of cents (0-99): 99 Quarters: 3 Dimes: 2 Nickels: 0 Pennies: 4   Continue? (y/n): y Enter number of cents (0-99): 55   Quarters: 2 Dimes: 0 Nickels: 1 Pennies: 0   Continue? (y/n): n   Bye! Specifications The program should display the minimum number of quarters, dimes, nickels, and pennies that one needs...

  • Python 3. Can anyone please help me with these two homework using Python 3. Thanks in...

    Python 3. Can anyone please help me with these two homework using Python 3. Thanks in advance 8. Tip, Tax, and Total Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total. 9. Celsius to Fahrenheit Temperature Converter Write...

  • Create a new program in Mu and save it as ps2.4.1.py Take the code below and...

    Create a new program in Mu and save it as ps2.4.1.py Take the code below and fix it as indicated in the comments: dividend = 7 divisor = 3 # You may modify the lines of code above, but don't move them! # Your code should work with different values for the variables. # The variables above create a dividend and a divisor. Add # some code below that will print the quotient and remainder # of performing this operation....

  • Create a program named my_dotProduct which USING LOOPS calculates the dot product of two vectors

    Problem 2: Matrix Vector Operationsa) Create a program named my_dotProduct which USING LOOPS calculates the dot product of two vectors (of dimensions \(1 \times n\) ) from the keyboard. The program should check the input from the user making sure that the vectors are the right dimensions. If the vectors are not then an error message should be outputted to the user. If the vectors are of the right dimensions then the answer should be outputted to the user. Using...

  • Write a program using Python that calculates the amount of money a person would earn over...

    Write a program using Python that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, then show the total pay at the end of the period. The output should be displayed...

  • Python Computer Programming Write a program that calculates the amount of money a person would earn...

    Python Computer Programming Write a program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of days. Display a table showing what the salary was for each day, then show the total pay at the end of the period. The output should be...

  • USING PYTHON PROGRAMING LANGUAGE Write a program that first asks the user to enter a “special”...

    USING PYTHON PROGRAMING LANGUAGE Write a program that first asks the user to enter a “special” letter. The program should then ask the user to enter a single line sentence containing all lowercase letters and no punctuation, except for a period at the end. The program will then output the number of times that this letter appears in the sentence. Example: Enter a special letter: t Enter a sentence: here is my little sentence. Your letter appears 3 times. (t...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT