Stuck, here's what I have thus far.   def calculate_meters(meters):     meters = int(input('Enter Feet: '))     meters = (meters * 0.3048)     meters = round(meters,2)     return meters      def calculate_feet(feet):     feet = int(input('Enter meters: '))     feet = (feet / 0.3048)     feet = round(feet,2)     return feet print('Feet and Meters Converter')       def mainmenu():     while True:         print('Feet and Meters Converter')         print()         print('Conversions Menu:')         print('a. Feet to Meters')         print('b. Meters to Feet')         choice = str(input('Select a conversion (a/b):'))         print()         if choice == 'a':             calculate_meters()             choice2 = str(input('Would you like to perform another conversion? (y/n): '))             while choice2 == 'y':                 pass             if choice == 'b':                 calculate_feet()                 choice2 = str(input('Would you like to perform another conversion? (y/n): '))                 while choice2 == 'n':                     print('Thanks, bye!')                     break

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Stuck, here's what I have thus far.

 

def calculate_meters(meters):
    meters = int(input('Enter Feet: '))
    meters = (meters * 0.3048)
    meters = round(meters,2)
    return meters
    
def calculate_feet(feet):
    feet = int(input('Enter meters: '))
    feet = (feet / 0.3048)
    feet = round(feet,2)
    return feet


print('Feet and Meters Converter')      
def mainmenu():
    while True:
        print('Feet and Meters Converter')
        print()
        print('Conversions Menu:')
        print('a. Feet to Meters')
        print('b. Meters to Feet')
        choice = str(input('Select a conversion (a/b):'))
        print()
        if choice == 'a':
            calculate_meters()
            choice2 = str(input('Would you like to perform another conversion? (y/n): '))
            while choice2 == 'y':
                pass
            if choice == 'b':
                calculate_feet()
                choice2 = str(input('Would you like to perform another conversion? (y/n): '))
                while choice2 == 'n':
                    print('Thanks, bye!')
                    break

**Feet and Meters Converter Program**

### Console Output

```
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!
```

### Program Specifications

- **Conversion Formulas:**
  - To convert feet to meters: 
    \[
    \text{meters} = \text{feet} \times 0.3048
    \]
  - To convert meters to feet: 
    \[
    \text{feet} = \text{meters} \div 0.3048
    \]

- **Code Structure:**
  - Create functions for each conversion:
    - Function to convert Feet to Meters.
    - Function to convert Meters to Feet.
  - Ensure each function accepts parameters and returns a value.
  - Create a function to display the conversion menu.
  - Main function to handle input and output, directing to the appropriate conversion functions based on user input.

- **User Input:**
  - Ensure the user inputs valid data for the conversions.

- **Output:**
  - Results should be rounded to a maximum of two decimal places.

### Grading Criteria

- **Functions:**
  - Create 3 main functions: one for converting feet to meters, one for converting meters to feet, and a menu function.
  - All functions must execute correctly.
  - Missing functions will result in a deduction of 10 points each.
- **Calculations:**
  - Incorrect calculations will result in a deduction of 10 points per error.
- **Input Handling:**
  - Incorrect handling or missing input handling in the main function will result in a deduction of 10 points.
- **Formatting and Errors:**
  - Proper formatting is required where blank lines and prompts should be appropriately placed.
  - Other errors, such as incorrect prompts or output not in main functions, will each result in a deduction of 10 points.

This program aims to help students understand and implement basic conversion calculations through a structured and
Transcribed Image Text:**Feet and Meters Converter Program** ### Console Output ``` 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! ``` ### Program Specifications - **Conversion Formulas:** - To convert feet to meters: \[ \text{meters} = \text{feet} \times 0.3048 \] - To convert meters to feet: \[ \text{feet} = \text{meters} \div 0.3048 \] - **Code Structure:** - Create functions for each conversion: - Function to convert Feet to Meters. - Function to convert Meters to Feet. - Ensure each function accepts parameters and returns a value. - Create a function to display the conversion menu. - Main function to handle input and output, directing to the appropriate conversion functions based on user input. - **User Input:** - Ensure the user inputs valid data for the conversions. - **Output:** - Results should be rounded to a maximum of two decimal places. ### Grading Criteria - **Functions:** - Create 3 main functions: one for converting feet to meters, one for converting meters to feet, and a menu function. - All functions must execute correctly. - Missing functions will result in a deduction of 10 points each. - **Calculations:** - Incorrect calculations will result in a deduction of 10 points per error. - **Input Handling:** - Incorrect handling or missing input handling in the main function will result in a deduction of 10 points. - **Formatting and Errors:** - Proper formatting is required where blank lines and prompts should be appropriately placed. - Other errors, such as incorrect prompts or output not in main functions, will each result in a deduction of 10 points. This program aims to help students understand and implement basic conversion calculations through a structured and
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY