Python Programming Problem: Design a temperature converter application by defining maximal number of user-defined functions. You need to define the following user-defined functions for converting temperatures between the various scales: - Fahrenheit to Celsius: °C = (°F – 32) ´ 5 ÷ 9 -Celsius to Fahrenheit: °F = °C ´ 9 ÷ 5 + 32 Create a main menu that allows a user to perform the temperature conversions between two different scales. The application should provide a user menu. You have the flexibility of designing the user menu. Conversion Function: Each conversion function should be defined with required parameter(s) and a return value. Return value will be printed inside the caller (in this case main menu function) function. No user input/ print statement will take place inside the conversion functions. Example: To define a function to convert between Fahrenheit to Celsius you need following: 1) Fahrenheit temperature will be passed as parameter 2) the return value be the converted Celsius temperature. The main menu function will 1) take the input from the user, 2) call the appropriate function passing right argument and 3) print the returned value from the function. Use data type conversion for user input as required and format function to display the outcome up to 2 decimal places. Docstring: All the functions should have well documentation as a form of docstring. The docstring will contain the following information: Function description, Parameter/Input, Return/output
Python
You need to define the following user-defined functions for converting temperatures between the various scales:
- Fahrenheit to Celsius: °C = (°F – 32) ´ 5 ÷ 9
-Celsius to Fahrenheit: °F = °C ´ 9 ÷ 5 + 32
Create a main menu that allows a user to perform the temperature conversions between two different scales. The application should provide a user menu. You have the flexibility of designing the user menu.
Conversion Function: Each conversion function should be defined with required parameter(s) and a return value. Return value will be printed inside the caller (in this case main menu function) function. No user input/ print statement will take place inside the conversion functions.
Example: To define a function to convert between Fahrenheit to Celsius you need following:
1) Fahrenheit temperature will be passed as parameter
2) the return value be the converted Celsius temperature.
The main menu function will 1) take the input from the user, 2) call the appropriate function passing right argument and 3) print the returned value from the function. Use data type conversion for user input as required and format function to display the outcome up to 2 decimal places.
Docstring: All the functions should have well documentation as a form of docstring. The docstring will contain the following information: Function description, Parameter/Input, Return/output
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images