Question

You will use an appropriate looping statement to write a script that displays a list of...

You will use an appropriate looping statement to write a 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 you learned in chapter 1 to display the Celsius temperature to one place after the decimal point. Save the document as TempConversion.php. [ Use php script solve this problem]

Homework Answers

Answer #1

To convert Fahrenheit to Celsius

<?php
  
for($F=0;$F<100;$F++)
{
$C=(5/9) * ($F -32);
echo round($C,1);
echo "<br>";
}

?>

To convert Celsius to Fahrenheit

<?php
  
for($C=0;$C<100;$C++)
{
$F=$C*(5/9) +32;
echo round($F,1);
echo "<br>";
}

?>

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ASP.Net with VISUAL C# Use an appropriate looping statment to write a program that prints a...
ASP.Net with VISUAL C# Use an appropriate looping statment to write a program that prints a list of the Celsius equivalents of zero degrees Fahrenheit through100 degrees Fahrenheit. To convert Fahrenheit to Celsius, subtract 32 from the Fahrenheit temperature, and then multiply the remainder by .55.
(1 point) Temperatures in LA. The average daily high temperature in November in Los Angeles is...
(1 point) Temperatures in LA. The average daily high temperature in November in Los Angeles is 73 degrees Fahrenheit with a standard deviation of 5 degrees Fahrenheit. Suppose that the temperatures in November closely follow a normal distribution. Round calculated answers to 4 decimal places. 1. What is the probability of observing an 78 degrees Fahrenheit temperature or higher in Los Angeles during a randomly chosen day in November? 2. How cold are the coldest 5% of the days during...
Temperatures in LA. The average daily high temperature in January in Los Angeles is 68 degrees...
Temperatures in LA. The average daily high temperature in January in Los Angeles is 68 degrees Fahrenheit with a standard deviation of 5 degrees Fahrenheit. Suppose that the temperatures in January closely follow a normal distribution. Round calculated answers to 4 decimal places. 1. What is the probability of observing an 76 degrees Fahrenheit temperature or higher in Los Angeles during a randomly chosen day in January? 2. How cold are the coldest 20% of the days during January in...
Temperatures in LA. The average daily high temperature in February in Los Angeles is 69 degrees...
Temperatures in LA. The average daily high temperature in February in Los Angeles is 69 degrees Fahrenheit with a standard deviation of 5 degrees Fahrenheit. Suppose that the temperatures in February closely follow a normal distribution. Round calculated answers to 4 decimal places. 1. What is the probability of observing an 74 degrees Fahrenheit temperature or higher in Los Angeles during a randomly chosen day in February? (?) 2. How cold are the coldest 15% of the days during February...
Temperatures in LA. The average daily high temperature in March in Los Angeles is 70 degrees...
Temperatures in LA. The average daily high temperature in March in Los Angeles is 70 degrees Fahrenheit with a standard deviation of 5 degrees Fahrenheit. Suppose that the temperatures in March closely follow a normal distribution. Round calculated answers to 4 decimal places. 1. What is the probability of observing an 75 degrees Fahrenheit temperature or higher in Los Angeles during a randomly chosen day in March? .1586 2. How cold are the coldest 5% of the days during March...
Use Python: the formula for converting a temperature from Fahrenheit to Celcius is C=5/9(f-32) where F...
Use Python: the formula for converting a temperature from Fahrenheit to Celcius is C=5/9(f-32) where F is the Fahrenheit temperatre and C is the celcius temperature. Write a function named celcius that accepts a Fahrenheit temperature as an argument. the function should return the temperature, convertedm to celcius. Demonstrate the function by calling it in a loop that displays a table of the fahrenheit temperatures 0 through 20 and their Celsius equivalents.
Create a program that the simulates a thermometer and displays its temperature using different units. 1-...
Create a program that the simulates a thermometer and displays its temperature using different units. 1- Temperature Interface (Temperature.java) This interface should declare the following two abstract methods: • getTemperature      o Returns a String o Accepts no arguments • setTemperature      o Returns void o Accepts one double argument 2- Abstract Thermometer Class (Thermometer.java) This abstract class must implement the Temperature interface and contain: • One private field (a double) named degrees • One constructor that accepts a double...
Selection control structure The if statement The switch statement (optional) Relational operators and logical operators Use...
Selection control structure The if statement The switch statement (optional) Relational operators and logical operators Use of relational and logical operators to check numeric ranges User friendly Use of user friendly user prompt and simple input validation Use of meaningful output labels and format Use of output manipulators Working with string type Use of getline() Project Description There are two main systems for measuring distance, weight and temperature, the Imperial System of Measurement and the Metric System of Measurement. Most...
Objective: Write a Java program that will use a JComboBox from which the user will select...
Objective: Write a Java program that will use a JComboBox from which the user will select to convert a temperature from either Celsius to Fahrenheit, or Fahrenheit to Celsius. The user will enter a temperature in a text field from which the conversion calculation will be made. The converted temperature will be displayed in an uneditable text field with an appropriate label. Specifications Structure your file name and class name on the following pattern: The first three letters of your...
Download the attached .java file. Run it, become familiar with its processes. Your task is to...
Download the attached .java file. Run it, become familiar with its processes. Your task is to turn TemperatureConversion into GUI based program. it should, at the least, perform similar functions as their text output versions. The key factor to remember is that the workings should remain the same (some tweaks may be necessary) between text and GUI programs, while the means pf visual presentation and user interaction changes. You must properly document, comment, indent, space, and structure both programs. import...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT