PHP Code for a Celsius/Fahrenheit convertor
- Posted:
- Archived
- Remote
- #34084
Web Development • Website, Portal, Application Development, Custom Web Design and Programming
Calcutta
PHP & MySQL Web Developer, HTML Web Developer
Komplek Angkatan Bersenjata Republik Indonesia Description
Use an appropriate looping statement to write a PHP script that displays a list of the Celsius equivalents of zero degrees Fahrenheit through 100 degrees Fahrenheit. To convert Fahrenheit to Celsius, subtract 32 from the Fahrenheit temperature, and then multiply the remainder by 5/9. To convert Celsius to Fahrenheit, multiply the Celsius temperature by (9/5), and then add 32. Use the round () function to display the Celsius temperature to one place after the decimal point. THIS PROJECT MUST BE COMPLETED BY FRIDAY, AUG. 27.
Clarification Board
-
$f=$degree*9/5+32; echo(round($f,2));
-
I can start today, what do you think?
-
Hi Mike, Does this need to be done in PHP? Every time the page loads the request will be sent to the server which will have to process and calculate it - a waste of the server's resources for a set of data which will be exactly the same every time. Would it not be better for the freelancer to provide a static table of converted numbers in oC and oF (which is what the PHP code would generate anyway) and save your server's resources? Stuart
