Assignment 1 - PHP Temperature

Hey folks. This will likely be the last time I require this, but please complete parts I and II "by hand," i.e. do not make use of Generative AI. Part III will have its own instructions.

"The Temperature Assignment"


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


Part I

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.


Part II

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

OR, even better

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.

For this you'd need to learn/review HTML/CSS colors, e.g. There are probably far easier options than RGB ☺

Part III


Okay, lets try out the AI stuff. I'd like you to embellish or modify your code here to try to add some kind of functionality, your choice. I'm going to put some limits here though:

1) No other languages besides HTML, CSS, and PHP. (We will definitely use Javascript later, but lets hold off on it for now)
2) No calls to external APIs. The only running code should be the code you provide.

State what your idea was, and outline the steps/prompts you used to try to get to your goal — Note: Failure IS an option here, if it DOESN'T work that should be just as interesting as well. For part III, only effort, not success, is required. This can be as small or large as you desire.

For turning in. Create another folder in your LIS5367 folder and call it "temperature." Name your MAIN (part I and II) project "index.php" — if you do this, then you should be able to see it at: http://torch.cci.fsu.edu/~YOURID/LIS5367/temperature

Additionally, turn your source code into Canvas as well. You can just copy and paste as text, if you like.

For Part III, you may come up with your own reasonable name for the file, but do please keep it in the "temperature" folder.



Backlinks: FSU Courses:LIS5367