Question

Write an M-File scripts that converts temperature in degrees Fahrenheit ( °F) to degrees Centigrade (...

Write an M-File scripts that converts temperature in degrees Fahrenheit (
°F) to

degrees Centigrade (

°C) by recall the conversion function in (a).
Use input and disp commands to display a mix of text and number.

Homework Answers

Answer #1
The input program would be:
%Program to convert from F to C
%Take the input from user
ftemp = input('Enter your values in Degree Fahrenheit: ');
%Convert the values from F to C using the conversion factor
%C  =  (F – 32) * 5/9
ctemp = (ftemp-32)*5/9; 
%In the above statement you can also use (ftemp-32)*(5/9) or many other
%combinations to avoid any problems with operator precedence.
fprintf('%f F = %f C\n',ftemp,ctemp);

The result display of the program would be like:

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
Program must be in JAVA. Write a program that converts temperature from Celsius to Fahrenheit or...
Program must be in JAVA. Write a program that converts temperature from Celsius to Fahrenheit or vice versa, depending on user's input. The formula for converting temperature in Celsius to Fahrenheit is, Fahrenheit = (9/5) * Celsius + 32 The formula for converting temperature in Fahrenheit to Celsius is, Celsius = (5/9) * (Fahrenheit – 32) Results should be rounded to two decimal points, e.g., 92.56
Write a Matlab function convert T such that convert T(x, ’C’) converts from degrees Celsius to...
Write a Matlab function convert T such that convert T(x, ’C’) converts from degrees Celsius to degrees Fahrenheit, while convert T(x, ’F’) converts from Fahrenheit to Celsius. Need to submit program online to see if successful. Please help! function T = convert_T (x, flag) %convert between Celsius and Fahrenheit temperatures %for example, convert_T(10, 'C') should return 50 %and convert_T(50, 'F') should return 10
Write a java program that asks for temperature in Fahrenheit. The program should accept any floating...
Write a java program that asks for temperature in Fahrenheit. The program should accept any floating point number. Display whether water is liquid, solid, or gas at that temperature at sea level. Display the results like this: “Water at that temperature is a solid/liquid/gas.” (Note: display only the correct state for that temperature.) water freezes at 32 degrees F and boils at 212 degrees F.
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.
Water freezes at 0 degrees Celsius, which is the same as 32 degrees Fahrenheit. Also water...
Water freezes at 0 degrees Celsius, which is the same as 32 degrees Fahrenheit. Also water boils at 100 degrees Celsius, which is the same as 212 degrees Fahrenheit. (Use fractions in your answers.) (a) Use the freezing and boiling points of water to find a formula expressing Celsius temperature C as a linear function of the Fahrenheit temperature F. (b)This means that for every one degree increase in the Fahrenheit temperature, the Celsius temperature will increase by what degree?
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale...
C++ Fahrenheit to Celsius Tables Write a program that first asks the user which Temperature scale conversion he/she would like to perform: 1. Convert F to C 2. Convert C to F 3. Quit What is your choice? Then it asks the user for input for three real number variables: start_temp, end_temp, temp_incr. It will then produce a two column Fahrenheit to Celsius table or a two column Celsius to Fahrenheit table, depending on the choice. For choice 1, the...
Please use C++ programming language write a program to convert temperature in Fahrenheit to temperature in...
Please use C++ programming language write a program to convert temperature in Fahrenheit to temperature in celcius.( no comments necessary). get the temperature in Fahrenheit. calculate the temperature in Celsius. and write  the output to screen. Celsius = (5/9) * (F-160)
Write a function called celsiusToFaherenheit which takes 1 input: degrees in Celsius, and returns one output:...
Write a function called celsiusToFaherenheit which takes 1 input: degrees in Celsius, and returns one output: degrees in Fahrenheit. The formula to convert Celsius to Fahrenheit is (°C × 9/5) + 32 = °F. Write a function called printCelsiusToFaherenheit which takes no inputs and returns no outputs. This function should use celsiusToFaherenheit from part 3 as a helper function. This function should print the value of 17 degrees Celsius converted to Fahrenheit.
I need to write a function in python that will take user input of temperature in...
I need to write a function in python that will take user input of temperature in degrees Celcius and convert it into degrees Fahrenheit. I am familiar with C++ but not python.
Using Python (Spyder), Write a function convert_temperature that takes two arguments: a float parameter temp, the...
Using Python (Spyder), Write a function convert_temperature that takes two arguments: a float parameter temp, the temperature to convert; and a str parameter conversion that determines which conversion to perform. Assume that conversion can take two possible values, 'celsius_to_fahrenheit' and 'fahrenheit_to_celsius', and make 'celsius_to_fahrenheit' the default value. Have your function print out a sentence explaining the conversion done, such as “0 °C converts to 32 °F”, and have the function return the converted value. Your submission should include the function...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT