def celsiusToFahrenheit(celsius): # Converts from Celsius to Fahrenheit def fahrenheitToCelsius(fahrenheit): # Converts from Fahrenheit to Celsius The formulas for the conversion are: celsius = (5 / 9) * (fahrenheit - 32) fahrenheit = (9 / 5) * celsius + 32 Example Output: Please select the following menu 1. Convert Fahrenheit to Celsius 2. Convert Celsius to Fahrenheit Enter 1 to select menu 1 and enter 2 to select menu 2: 1 Enter the temperature in Fahrenheit: 120.0 120.0F = 48.89C
Added by Debra S.
Close
Step 1
Inside this function, there is another function fahrenheitToCelsius(fahrenheit) which converts from Fahrenheit to Celsius. The formulas for the conversion are also provided. Step 2: We are asked to create a menu for the user to select whether they want to convert Show more…
Show all steps
Your feedback will help us improve your experience
Willis James and 52 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
(Conversions between Celsius and Fahrenheit) Write a module that contains the following two functions: # Converts from Celsius to Fahrenheit def celsiusToFahrenheit(celsius): $\#$ Converts from Fahrenheit to Celsius def fahrenheitToCelsius(fahrenheit): The formulas for the conversion are: \[\begin{array}{l}\text { celsius }=(5 / 9)^{*} \text { (fahrenheit }-32 \text { ) } \\\text { fahrenheit }=(9 / 5) \text { the celsius }+32\end{array}\] Write a test program that invokes these functions to display the following tables:
Akash M.
Write a program to obtain temperature in Celsius and convert it into Fahrenheit using the formula: F = C * 9/5 + 32 in Python.
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD