Programming Exercises 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, then calculate the amounts of a 18 percent tip and 7 percent sales tax. Display each of these amounts and the total. 9. Celsius to Fahrenheit Temperature Conuer 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PYTHON PROGRAMMING ONLY PLEASE 

NUMBER 8 NEED HELP WITH 

am
ent
the
the
of gas
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, then calculate the amounts
of a 18 percent tip and 7 percent sales tax. Display each of these amounts and the total.
9. Celsius to Fahrenheit Temperature Converter
mula is as follows:
Write a program that converts Celsius temperatures to Fahrenheit temperatures. The for-
F = ²C + 32
The program should ask the user to enter a temperature in Celsius, then display the tem-
perature converted to Fahrenheit.
10. Ingredient Adjuster
A
cookie recipe calls for the following ingredients:
1.5 cups of sugar
1 cup of butter
• 2.75 cups of flour
Programming Exercises
• 1.5
that
The recipe produces 48 cookies with this amount of the ingredients. Write a program
asks the user how many cookies he or she wants to make, then displays the number of cups
of each ingredient needed for the specified number of cookies.
11. Male and Female Percentages
Write a program that asks the user for the number of males and the number of females regis-
tered in a class. The program should display the percentage of males and females in the class.
Hint: Suppose there are 8 males and 12 females in a class. There are 20 students in the
class. The percentage of males can be calculated as 8 ÷ 20 = 0.4, or 40%. The percentage
of females can be calculated as 12 + 20 = 0.6, or 60%.
12. Stock Transaction Program
Last month, Joe purchased some stock in Acme Software, Inc. Here are the details of the
purchase:
• The number of shares that Joe purchased was 2,000.
• When Joe purchased the stock, he paid $40.00 per share.
Joe paid his stockbroker a commission that amounted to 3 percent of the amount he paid
for the stock.
Two weeks later, Joe sold the stock. Here are the details of the sale:
• The number of shares that Joe sold was 2,000.
• He sold the stock for $42.75 per share.
• He paid his stockbroker another commission that amounted to 3 percent of the amount
he received for the stock.
Write a
program that displays the following information:
The amount of money Joe paid for the stock.
The amount of commission Joe paid his broker when he bought the stock.
• The amount for which Joe sold the stock.
115
Transcribed Image Text:am ent the the of gas 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, then calculate the amounts of a 18 percent tip and 7 percent sales tax. Display each of these amounts and the total. 9. Celsius to Fahrenheit Temperature Converter mula is as follows: Write a program that converts Celsius temperatures to Fahrenheit temperatures. The for- F = ²C + 32 The program should ask the user to enter a temperature in Celsius, then display the tem- perature converted to Fahrenheit. 10. Ingredient Adjuster A cookie recipe calls for the following ingredients: 1.5 cups of sugar 1 cup of butter • 2.75 cups of flour Programming Exercises • 1.5 that The recipe produces 48 cookies with this amount of the ingredients. Write a program asks the user how many cookies he or she wants to make, then displays the number of cups of each ingredient needed for the specified number of cookies. 11. Male and Female Percentages Write a program that asks the user for the number of males and the number of females regis- tered in a class. The program should display the percentage of males and females in the class. Hint: Suppose there are 8 males and 12 females in a class. There are 20 students in the class. The percentage of males can be calculated as 8 ÷ 20 = 0.4, or 40%. The percentage of females can be calculated as 12 + 20 = 0.6, or 60%. 12. Stock Transaction Program Last month, Joe purchased some stock in Acme Software, Inc. Here are the details of the purchase: • The number of shares that Joe purchased was 2,000. • When Joe purchased the stock, he paid $40.00 per share. Joe paid his stockbroker a commission that amounted to 3 percent of the amount he paid for the stock. Two weeks later, Joe sold the stock. Here are the details of the sale: • The number of shares that Joe sold was 2,000. • He sold the stock for $42.75 per share. • He paid his stockbroker another commission that amounted to 3 percent of the amount he received for the stock. Write a program that displays the following information: The amount of money Joe paid for the stock. The amount of commission Joe paid his broker when he bought the stock. • The amount for which Joe sold the stock. 115
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education