Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a program that converts feet to meters and vice versa. Specifications The formula for converting feet to meters is: feet = meters / 0
Create a program that converts feet to meters and vice versa.
Specifications
The formula for converting feet to meters is: feet meters
The formula for converting meters to feet is: meters feet
Store the code that performs the actual conversions in separate functions within a separate code module named "conversions.py These two functions will take a single parameter and return the resulting conversion value. Close the file
Start a new py file and use an "import" statement to import your custom module into this new file
Write a separate function to display the program bannertitle
Write a separate function to display the menu as shown below in the sample output
Write the rest of the code to take the user input call the proper functions display output all in a main function.
Note: The code inside the main function should continue inside a While loop until the user is ready to quit.
Coding steps:
Display the title by calling the correct function
Display the menu by calling the correct function
Begin a loop and first ask the user for a conversion choice save the input to a variable
Use an ifelifelse to determine which choice was made. If something was entered other than a or b alert the user.
If the choice is a or b then ask for the number of feet or meters. Make sure to convert this input to float and save the result to a variable
Call the correct function from the "conversion.py module, passing in the user input, to do the conversion calculation.
Print the results using the round function
Prompt the user to continue or not. Exit the loop on n and print "Bye!"
NOTE: You can assume the user will enter valid data no validation code required Also, the program should round results to a maximum of two decimal places.
Sample inputoutput:
Feet and Meters Converter
Conversions Menu:
a Feet to Meters
b Meters to Feet
Select a conversion ab: a
Enter feet:
The answer is meters
Would you like to perform another conversion? yn: y
Conversions Menu:
a Feet to Meters
b Meters to Feet
Select a conversion ab: b
Enter meters:
The answer is feet
Would you like to perform another conversion? yn: n
Thanks, bye!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started