Question: Question 5 : Revisit Question 4 in Assignment 1 . Rewrite your code using a loop structure. Use the screenshot below as a reference. (

Question 5: Revisit Question4 in Assignment1. Rewrite your code using a loop structure. Use the screenshot below as a reference. (20 pts.)
```
Feet and Meters Converter
Conversions Menu:
a. Feet to Meters
b. Meters to Feet
Select a conversion (a/b): a
Enter feet: 100
30.48 meters
Would you like to perform another conversion? (y/n): y
Conversions Menu:
a. Feet to Meters
b. Meters to Feet
Select a conversion (a/b): b
Enter meters: 100
328.08 feet
Would you like to perform another conversion? (y/n): n
Thanks, bye!
```
(5a) Store the code that displays the menu in its own function, but store the rest of the code that gets input and displays output in another conversion() function. (5 pts .)
(5b) Use the following conversion rules.
- feet \(=\) meters \(/0.3048\)
- meters \(=\) feet *0.3048
(5c) Include a preventive mechanism such that the program will ask the user to re-enter a valid number if a nonnumeric value is received at the first prompt. The program should round results to a maximum of two decimal places. (7 pts.)
(5d) Based on the user input ( y or n ), your program should be able to either continue on with another conversion or terminate. If the user enters a third value, display a message noting that this option is not valid. (8 pts .)
(5e) Be mindful of whitespaces between lines or within one line.
Question 5 : Revisit Question 4 in Assignment 1 .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!