CS110 Introduction to Computing
Fall 2006
Lab Assignment#2
In this assignment you are required to solve two problems (in two separate Python programs).
Assignment:
Problem#1: When Americans discuss the fuel efficiency of automobiles they use miles/gallon (MPG) as their criteria. For example, a 1999 Mazda Protege lists its fuel efficiency as 22MPG (City) and 26MPG (Highway). Europeans and people in other countries that use the metric system typically use the litres/100-kilometers as their fuel efficiency criteria (i.e. how many litres will the car take to drive 100 kilometers). Write a Python program that takes a fuel rating in MPG and converts it to litres/100-kilometers. For your final output, pick a specific car, find out its rating (city and highway) and show your program's output for that car. Make sure you mention the make, model, and year of the car in your write up.
Problem#2: Do programming Exercise 6 in Chapter 2 of Zelle (page 49). Show your program's output for a starting investment of $5000.00, a yearly investment of $1200 (starting in the second year), and an interest rate of 5% (APR).
What you will need to do
Notes:
Add the following line to all your Python programs:
# File: <place name of your program file here> # Date: <date created> # Created by: <your name> # Assignment: <place assignment number here>