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

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage