Fahrenheit to Celsius Converter assignment 1

Fahrenheit to Celsius Converter assignment 1 - Fahrenheit...

Info iconThis 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: 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.
Background image of page 1

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

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

This note was uploaded on 03/07/2010 for the course CIS CIS105/100 taught by Professor Mr.mccoy during the Spring '10 term at Elgin Community College.

Page1 / 2

Fahrenheit to Celsius Converter assignment 1 - Fahrenheit...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online