Question

In: Computer Science

1. Temperature in kelvins (K) is related to the temperature in degrees Fahrenheit (°F) by the...

1. Temperature in kelvins (K) is related to the temperature in degrees Fahrenheit (°F) by the equation Design a MATLAB program that will do the following a. Prompt the user to enter an input temperature in °F. b. Read the input temperature. c. Calculate the temperature in kelvins in a separate function d. Write out the results with two digits to the right of the decimal (Use the fprintf function). The results should go to the command window.

Solutions

Expert Solution

Code to write in the script file:

% Function to convert temperature in degree Fahrenheit to degree Kelvin
function temp_in_C = tempCalculate ()
temp_in_F = input("Enter temperature in degree Fahrenheit: ");
temp_in_C = (temp_in_F - 32).*(5./9);
fprintf('Temperature in degree Celsius: %.2f',temp_in_C)
  
end

Code for command window:

% Calling the function

tempCalculate();

Enter temperature in degree Fahrenheit:

36

Temperature in degree Celsius: 2.22

% One more example

tempCalculate();

Enter temperature in degree Fahrenheit:

56

Temperature in degree Celsius: 13.33

Screenshots for the same:

*NOTE: Drop a comment for queries.


Related Solutions

The temperature X in degrees Fahrenheit (F) of a particular chemical reaction is known to be...
The temperature X in degrees Fahrenheit (F) of a particular chemical reaction is known to be distributed between 220 and 280 degrees with a probability density function of fX(x) = (x − 190)/3600. A value of X degrees Fahrenheit can be converted to Y degrees Celsius (C) by taking Y = (5/9)(X − 32). Determine the following in both degrees F and degrees C: (a) the mean of the distribution (b) the variance of the distribution (c) the cumulative distribution...
Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The...
Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The table should include rows for all temperatures between 0 and 100 degrees Celsius that are multiples of 10 degrees Celsius. Include appropriate headings on your columns. The formula for converting between degrees Celsius and degrees Fahrenheit can be found on the internet. Python 3
Convert the boiling temperature of gold, 2966 °C, into degrees Fahrenheit and kelvin.
Convert the boiling temperature of gold, 2966 °C, into degrees Fahrenheit and kelvin.  
The temperature in degrees Fahrenheit and the number of emergency calls are shown below. Determine if...
The temperature in degrees Fahrenheit and the number of emergency calls are shown below. Determine if there is a relationship between the temperature and the number of emergency calls received. Use .05 significance. Number of Calls (Y) Temperature (X) 7 68 4 74 8 82 10 88 11 93 9 99 13 101 What is the p value and is it significant? Select one: a. .1898, no it is not significant. b. .0267, yes it is significant. c. .2162, yes...
The high temperature (in degrees Fahrenheit), x, and the ice cream sales (in dollars) for a...
The high temperature (in degrees Fahrenheit), x, and the ice cream sales (in dollars) for a local store, y, are related by the regression line equation y = -392.966 + 8.791x. Find the amount of sales predicted by the model if the high temperature is x = 94°F. Give your answer as a monetary amount rounded to the nearest cent.
The mean temperature for the month of July in Boston, Massachusetts is 73 degrees Fahrenheit. Plot...
The mean temperature for the month of July in Boston, Massachusetts is 73 degrees Fahrenheit. Plot the following data, which represent the observed mean temperature in Boston over the last 20 years: 199872199969200078200170200267200374200473200565200677200771200875200968201072201177201265201379201477201578201672201774 Is this a normal distribution? Explain your reasoning. What is an outlier? Are there any outliers in this distribution? Explain your reasoning fully. Using the above data, what is the probability that the mean will be over 76 in any given July? Using the above data, what...
The mean temperature for the month of July in Boston, Massachusetts is 73 degrees Fahrenheit. Plot...
The mean temperature for the month of July in Boston, Massachusetts is 73 degrees Fahrenheit. Plot the following data, which represent the observed mean temperature in Boston over the last 20 years: 199872199969200078200170200267200374200473200565200677200771200875200968201072201177201265201379201477201578201672201774 Is this a normal distribution? Explain your reasoning. What is an outlier? Are there any outliers in this distribution? Explain your reasoning fully. Using the above data, what is the probability that the mean will be over 76 in any given July? Using the above data, what...
a. The probability that the temperature will fall below 32 degrees Fahrenheit on any given day...
a. The probability that the temperature will fall below 32 degrees Fahrenheit on any given day is 20%. If the temperature does fall below 32 degrees, then there is an 80% chance of ice/frost. What is the probability that on any given day, the temperature will fall below 32 degrees and there will be ice/frost? (Input answer as a decimal, rounded to three decimal places if necessary b.In the card game Pokemon, players must construct a 60-card deck to play...
Let x be a random variable that represents the average daily temperature (in degrees Fahrenheit) in...
Let x be a random variable that represents the average daily temperature (in degrees Fahrenheit) in July in a town in Colorado. The x distribution has a mean μ of approximately 75°F and standard deviation σ of approximately 8°F. A 20-year study (620 July days) gave the entries in the rightmost column of the following table. I         II III IV Region under Normal Curve x°F Expected % from Normal Curve Observed Number of Days in 20 Years μ – 3σ...
The temperature function (in degrees Fahrenheit) in a three dimensional space is given by T(x, y,...
The temperature function (in degrees Fahrenheit) in a three dimensional space is given by T(x, y, z) = 3x + 6y - 6z + 1. A bee is constrained to live on a sphere of radius 3 centered at the origin. In other words, the bee cannot fly off of this sphere. What is the coldest temperature that the bee can experience on this sphere? Where does this occur? What is the hottest temperature that the bee can experience on...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT