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:
- Hair Dryer: 1800 watts
- Space heater: 600-1500 watts (usually these have low and high settings)
- Desktop Computer: 150 watts
- Fancy desktop computer while gaming: 400 watts (even if you have a 1,000 watt PSU, you're probably not using 1,000 watts)
- Electric stove burner: 3,000 watts (depends on size and setting...)
- Welder: 1,500 watts, unless you're fixing a bulldozer
- Laptop: 15 watts
- iPhone charger: 3 watts
- Lamp, "regular" bulb: 100 watts
- Lamp, with CFL: 23 watts
- Projector: 300 watts
- Baseboard heater: 2,500 watts (depends on length)
- Forced air electric furnace: 25,000 watts (if you have one, it'll be on the second-biggest breaker in your panel)
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.