Fahrenheit to Celsius Converter assignment 1

# Fahrenheit to Celsius Converter assignment 1 - Fahrenheit...

This preview shows pages 1–2. Sign up to view the full content.

Fahrenheit to Celsius Converter The formula to convert fahrenheit temperature to celsius is: 5 celsius = (fahrenheit - 32) * --- 9 Write a PHP program that will print a table of Fahrenheit and Celsius temperatures for each degree Fahrenheit from 0 to 100. Print the Celsius temperatures to one decimal place. To do so, remember the round() function which we used previously. As a refresher, here is an example of the round() function: \$n = round(\$n,2); This example will round the value of \$n to 2 decimal places . You will need to round your values to 1 decimal place , so you'll need to adjust the values of that function accordingly. HTML trick: to print the degree symbol, as in 77°, use &deg; Extra credit 1: Allow your program to accept an optional querystring to get the range of Fahrenheit temperatures desired. For example: http://cis2.elgin.edu/cis105xx/temperatures.php?from=50&to=70 This should print a table with Fahrenheit temperatures ranging from 50 to 70. Again, the querystring should be optional, so if "from" is omitted, start at 0. If "to" is omitted, stop at 100.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern