CS 110 Lab Project 2
Due: By class time Thursday, September 13th
In this lab, you will practice skills learned in Chapter 2 of your textbook involving input, computation (assigning and computing with variables and constant literal numbers), and output. The last two problems involves graphics and will demonstrate some repetitive code.
Problem 1: Land Calculation
One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. Call your program land.py.
Problem 2: Distance Traveled
Assuming there are no accidents or delays, the distance that a car travels down an interstate can be calculated with the following formula:
Distance = Speed x Time
A car is traveling at 60 miles per hour. Write a program that uses variables for speed, for time, and for distance, and calculates and then displays the following:
- The distance the car will travel in 5 hours
- The distance the car will travel in 8 hours
- The distance the car will travel in 12 hours
Name your program distance.py.
Problem 3: Celsius to Fahrenheit Temperature Converter
Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows:
F = 9/5 C + 32
Note that this is intentionally _not_ the Python statement/expression required. The program should ask the user to enter a temperature in Celsius, and then display the temperature converted to Fahrenheit. Make sure you test the program with a significant number of inputs and verify your answers. Name your program temp.py.
Problem 4: Circles
Use the graphics library to create a sequence of circles on the page. The sequence should be "regular" with a pattern to the coordinates, or to the radii, or both. You should have at least 10 circles in your pattern. Call your program circles.py.
Problem 5: Checkerboard
Use the graphics library to create a total of 64 squares, arranged in an 8x8 checkerboard pattern in the graphics window. Just like in a real checkerboard, the colors should be alternating red and black in a row, and alternating rows should begin with different initial colors. Name your program grid.py.