Question

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.

Homework Answers

Answer #1

#takes celsius and converts to Faherenheit

def celsiusToFaherenheit(c):

return (c * 9.0/5.0) + 32

def printCelsiusToFaherenheit():

#converting into Faherenehit

#printing the result

f = (17 * 9.0/5.0) + 32;

print("17 degrees Celsius converted to Fahrenheit : ",f)

print("37 degrees Celsius converted to Fahrenheit : ",celsiusToFaherenheit(37))

printCelsiusToFaherenheit()

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
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
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?
Write a function custom sort(v) that takes as input a vector v and as output returns...
Write a function custom sort(v) that takes as input a vector v and as output returns the vector w sorted into increasing order. For example, if the input is [−2 1 3 1 5], the output should be [−2 1 1 3 5]. Don’t use the built-in ”sort” function or anything similar. matlab question
Write a function called light_speed that takes as input a row vector of distances in kilometers...
Write a function called light_speed that takes as input a row vector of distances in kilometers and returns two row vectors of the same length. Each element of the first output argument is the time in minutes that light would take to travel the distance specified by the corresponding element of the input vector. To check your math, it takes a little more than 8 minutes for sunlight to reach Earth which is 150 million kilometers away. The second output...
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...
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...
TO BE DONE IN PYTHON: Write a function `lowest_integer()` which takes 2 input arguments: 1)a function...
TO BE DONE IN PYTHON: Write a function `lowest_integer()` which takes 2 input arguments: 1)a function `g` representing an increasing function g(x) 2) a number `gmin`, and returns an integer `nmin` such that nmin>0 is the smallest integer that satisfies g(nmin)>gmin. test: def g(n): return 2*n print(lowest_integer(g, 10)) Output: 6
Write a python function called unique words that takes a phrase as an input string and...
Write a python function called unique words that takes a phrase as an input string and returns a list of the unique words found in that phrase. The words should be listed in alphabetical order.
Using C programming Create a function called printMenu( ) with the following properties: Has no function...
Using C programming Create a function called printMenu( ) with the following properties: Has no function inputs or output. Prints the following menu to the screen: 1. Enter user name. 2. Enter scores. 3. Display average score. 4. Display summary. 5. Quit Create a function called printLine( ) with the following properties: Takes as input a char Takes as input an integer corresponding to the number of times to print the character Has no function output. For example, if we...
In R- Studio : Write a function that takes as an input a positive integer and...
In R- Studio : Write a function that takes as an input a positive integer and uses the print() function to print out all the numbers less than the input integer. (Example: for input 5, the function should print the numbers 1,2,3,4 { for input 1, the function should not print a number.) Write a recursive function, do not use any of the loop commands in your code.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT