CSIT 216 Lab 2 Python
CSIT 216 Lab 2 Python
For lab 2 complete the following Programming Exercises from Chapter 2: #7 (Miles-per
Gallon), #8 (Tips, Tax, and Total), and #9 (Celsius to Fahrenheit Temp Converter). You
may need to use the Table of Contents to jump to this section in the ebook.
You can put all of these in one file, or keep and attach them as separate python files
For a few points Extra Credit, try out #15 to experiment with the Turtle graphics. (The
Extra Credit is Optional)
Due: Sunday, June 18, 2023
This assignment meets Course Objectives 1, 2, 4, and 10.
Miles-per-Gallon
Write a program that asks the user for the number of miles driven and the gallons of gas used. It should
calculate the car's MPG and display the result.
Problem
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
Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as
follows:
F + 9/5C + 322
The program should ask the user to enter a temperature in Celsius, then display the temperature
converted to Fahrenheit.
Long description
Back
Two triangles with the same base. The smaller triangle is inscribed within the larger one.
A hexagon in which a pair of opposite sides are longer than the others. The diagonals are drawn.
Five circles, of which three are placed horizontally one beside the other. These circles do not intersect.
The other two circles are drawn below, such that they intersect each pair of the first three circles,
respectively.
Two axes which intersect each other at 90 degrees. The axes depict the four cardinal directions, north,
south, east, and west. A small circle centered at the origin is drawn through the axes.
A square with two diagonals that intersect at the center. The top and bottom sides of the square are
represented using dashed lines.