Fahrenheit to Celsius Converter assignment 1

Fahrenheit to Celsius Converter assignment 1 - Fahrenheit...

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

View Full Document Right Arrow Icon
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 ° 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.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern