Created Friday 21 April 2017
"The Temperature Assignment"
For this assignment, you will use some of the skills picked up in our last class. For each numbered portion, you should have a different individual file, feel free to copy and paste code between those as needed.
1) First, I'd like you to do is to programmatically create a celsius/Fahrenheit conversion table, which will ultimately look somewhat like the following:
0 degrees F is equivalent to - 17.7 C, which is cold 1 degrees F is equivalent to -17.2 C, which is cold ... ... 76 degrees F is equivalent to 22.2 C, which is nice ... ... 100 degrees F is equivalent to 37.77 C, which is hot
It should have AT LEAST 100 lines/entries and should have at least 3 "gradations" of temperature (hot, cold, warm, nice, etc) -- the names and amount are up to you, though they should be reasonable. Additionally *color* each description accordingly; make "hot" red, "cold" blue, etc.
Decimal accuracy should be at least to the 10th for C. The "somewhat quick" conversion is fine, i.e.
F to C - Subtract 32, multiply by 5/9
C to F, Multiply by 9/5, add 32
To break it down, you'll need to think about the following tasks:
- How to do math
- How to do a finite loop, incrementing numbers
- How to select an english description based on number input.
2) Same as above, but give each line its OWN color (slightly different from the one before and after) , resulting in a smooth gradient from a deep blue for cold to a bright red for hot.
3) Finally, make this interactive: With a form, create a dialogue that
- allows the user to make the selection of C to F or F to C and
- prompts the user for a number.
Be sure to return an error if improper input is given.