Question: Write a PHP program asg4.php that will display a form asking for four parameters: Convert F to C or C to F in a drop
Write a PHP program asg4.php that will display a form asking for four parameters:
- Convert F to C or C to F in a drop down list.
- the starting Fahrenheit/Celsius degree
- the ending Fahrenheit/Celsius degree
- the increment in Fahrenheit/Celsius
On the Fahrenheit temperature scale, water freezes at 32 degrees and boils at 212 degrees. On the Celsius scale, water freezes at 0 degrees and boils at 100 degrees. If you want to convert from Fahrenheit to Celsius, you subtract 32 from the temperature, multiply by 5, and divide by 9. To convert from Celsius to Fahrenheit, you multiply by 9, divide by 5, and then add 32.
Then the program asg4.php will call itself. That is, the action part of the form is the same file name. The PHP program file name can be changed and yet you do not need to change the source code.
Upon the second entry of the program asg4.php, it will print out a table of Fahrenheit and Celsius temperature equivalents from starting degrees to ending degrees with increment degree.
For example, if your drop down list is F to C and input starting value = 0; ending value = 100 and increment = 5 the output will be similar to the one shown above. You may use floating point instead of integer and the display can be 0.0 instead of 0. That is the display is similar and not necessarily totally identical.
To format the output nicely, you should use
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

