Question

7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the Fahrenheit temperatur
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since it is not mentioned in which language the program needs to be implemented, MATLAB is selected to develop the code.

MATLAB Code

%initializing the vector of Fahrenheit
fh=0:20;
%Display the heading on the command window
fprintf('Fahrenheit\tCelsius\n')
%'for' loop calling 'celsius' function
for m=1:length(fh)
%Calling 'celsius' function
cg=celsius(fh(1,m));
%Display fahrenheit and celsius temperature on command window.
fprintf('%1.2f\t\t%1.2f\n',fh(m),cg)
end
%function definition
function c=celsius(f)
c=5/9*(f-32);
end

Output on the command window

Fahrenheit   Celsius
0.00       -17.78
1.00       -17.22
2.00       -16.67
3.00       -16.11
4.00       -15.56
5.00       -15.00
6.00       -14.44
7.00       -13.89
8.00       -13.33
9.00       -12.78
10.00       -12.22
11.00       -11.67
12.00       -11.11
13.00       -10.56
14.00       -10.00
15.00       -9.44
16.00       -8.89
17.00       -8.33
18.00       -7.78
19.00       -7.22
20.00       -6.67

Add a comment
Know the answer?
Add Answer to:
7. Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is the...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to...

    C++ Code needed    Celsius Temperature Table The formula for converting a temperature from Fahrenheit to Celsius is C =5/9(F -32) where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named celsius that accepts a Fahrenheit temperature as an argument. The function should return the temperature, converted to Celsius. Demonstrate the function by calling it in a loop that displays a table of the Fahrenheit temperatures 0 through 20 and their Celsius equivalents.

  • For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula...

    For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Fahrenheit that accepts a Celsius temperature as an argument and returns the temperature converted to Fahrenheit. Demonstrate the function by accepting a Celsius temperature from a user and displaying the temperature converted...

  • write program in java 5. Falling Distance When an object is falling because of gravity, the...

    write program in java 5. Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: d = 1/2 gta The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a method named fallingDistance that accepts an object's falling time...

  • Write a program that displays a table of Celsius temperatures 0 through a number entered by...

    Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is: F = 9 / 5 * C + 32 where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place. Write a program that displays a...

  • This project is for my intro to C++ class. Below is the wording for the project....

    This project is for my intro to C++ class. Below is the wording for the project. "In this module, you learned about creating functions in C++ and how to combine functions with the concepts covered in previous modules to solve problems. For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and...

  • Write a program that displays a table of the Celsius temperatures 0 through 20 and their...

    Write a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit equivalents. use formula for converting celsius to faremnheit

  • Write a C++ console application that displays a table of Celsius temperatures from 0 through 20...

    Write a C++ console application that displays a table of Celsius temperatures from 0 through 20 and their equivalent Fahrenheit temperature values. The formula for converting from Celsius to Fahrenheit is: [In C++ Please] F==C + 32 Where, C is the temperature value in Celsius, and F is the equivalent temperature in Fahrenheit. Your program must use a loop to display the temperature values.

  • In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as...

    In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=(9/5)C+32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.

  • Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=95C+32...

    Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=95C+32 The program should ask the user to enter a temperature in Celsius, and then display the temperature converted to Fahrenheit. I'm doing this on Python.

  • Write a Temperature class that will hold a temperature in Fahrenheit, and provide meth- ods to...

    Write a Temperature class that will hold a temperature in Fahrenheit, and provide meth- ods to get the temperature in Fahrenheit, Celsius, and Kelvin. The class should have the following field: • ftemp – A double that holds a Fahrenheit temperature. The class should have the following methods: Constructor – The constructor accepts a Fahrenheit temperature (as a double) and stores it in the ftemp field. setFahrenheit – The setFahrenheit method accepts a Fahrenheit temperature (as a double) and stores...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT