Project 1: Cost of power

Due Thursday, September 8, at 9:00 AM

Suppose that, motivated either by environmental concern or financial concern, you have decided to find out how much electricity each device in your house uses. Conveniently, most devices are labeled by a power draw in watts, an unit named after James Watt, who is one of my ancestors. Here are a few typical examples: Write a program that will accept two inputs from the user: watts, and the cost of a KW/h of power (8.2 cents, according to my latest power bill). Add functionality so that if the user presses enter without entering anything for the cost of power, the program defaults to 8.2 cents per kilowatt hour. If the user doesn't enter anything for the number of watts, handle the situation gracefully (don't let the program crash).
The program should print out three numbers: The cost to use the device for 10 minutes, 1 hour, and 1 day.

Extra Credit

For a 10% bonus on the assignment, allow the user to input three devices, then use PyPlot or another graph library to generate a bar graph showing the relative power consumption of each.

Turning in the Project

Upload your completed project here. Name your file with your first and last name, like this: lastname_firstname_p1.py. So I would name project 1 long_seth_p1.py.