Question
Write a python program that displays the menu program as shown below. Option 1: Sum of two numbers Option 2: Area of a triangle Option
Write a python program that displays the menu program as shown below. Option
1: Sum of two numbers Option
2: Area of a triangle Option
3: Square root of a number
Accept an option from the user as an integer type. Based on the user input option, perform the following operations. For each option number, perform the respective tasks.
Option Tasks
1. Accept two integer numbers and add them and display the sum.
2. Accept the base and height of a triangle as float types and compute the area of the triangle using the formula Area = * base * height. Display the area in a floating point with two digits after the decimal point.
3. Import the math module and accept an integer number from the user and print the square root of the input number. The output should be in integer datatype.
4. Exit from the program
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