PHP Assignment 1 - The Temperature Assignment

Created Thursday 23 May 2019

"The Temperature Assignment"


For this assignment, you will use some of the skills picked up in our last class(es).

What 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, balmy, tropical, freezing etc) -- the precise names and amount are up to you, though they should be reasonable.

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:

1) How to do math

2) How to do a finite loop, incrementing numbers

3) How to select an english description based on number input.

You might want to tackle each of these seperately.

BONUS (I mean, for brownie points only, no extra credit unless I'm amazed)

Also, *color* each description accordingly; make "hot" red, "cold" blue, etc.

SUPERBONUS (ditto)

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.

TO TURN IN: In your ITPRO public html folder, create a subfolder called "php" — then save a file with your code called "temperature.php" into this folder, so that:
http://FSUID.itpro.cci.fsu.edu/php/temperature.php
displays your work. For the bonuses, you may do "bonustemp.php" and "superbonustemp.php" or similar — regardless-- when your work is in a completed state --- visit the Canvas Assignment corresponding to this and, in text, provide the working URL (or URLs) to your results.

Finally, visit the PHP Temperature Assignment Link in Canvas and provide url(s) to your work.




Backlinks: FSU Courses:LIS5367