Due Tuesday, April 22, 11:59pm
For this assignment you will use loops and the TinyWebDB to analyze home energy usage.
Requirements:
- (10 points) Allow a user to select or enter a date between March 1, 2014 and March 31, 2014. (The database only has data for the month of March, 2014.) You may use a list picker or a text box, or any other input mechanism of your choosing.
- (10 points) Use the TinyWebDB GetValue block to contact the database at the ServiceURL http://cs107s14.appspot.com and retrieve the appropriate data. The tag specified must be of the form 03DD14 where DD is the day selected by the user. Values range from 01 to 31, for example 030514 and 031514 are valid. Make sure to add the 0 if the day is less than 10. 03414 is NOT valid. You will get back a list of 24 floating point numbers, one for each hour of the day.
- (20 points) Report the following calculations for the daily usage data. You must use at least one while loop and one for loop to perform your calculations.
- total daily usage (sum of all hours of the day)
- minimum hourly usage
- maximum hourly usage
- mean hourly usage
- (5 points) For the minimum and maximum hourly usage values, report the hour in which the value occurred, for example "Your minimum usage was .3 KWh from 1-2am." The list retrieved from TinyWebDB is ordered such that the first value is the energy consumption from midnight to 1am, the second value is the energy consumption from 1-2am, and so on.
- (5 points) Visual design.
Extra credit:
- (5 points) Provide an option to display the day with the highest total usage for the month. To do this, you will need to download data for each day, calculate the total usage for that day, and compare it to the maximum