Question
Perl is the programming language Write a program that performs simple addition, subtraction, multiplication, and division. It should first ask the user to choose which
Perl is the programming language
Write a program that performs simple addition, subtraction, multiplication, and division. It should first ask the user to choose which operation they wish to perform, then prompts the user for two numbers. The program should pass the two numbers to one of the following functions, depending on which operation the user selects: addition(), subtraction(), multiplication(), division(). Make sure not to allow zero as the second input when performing division.
Example: Choose an Operation:
1. Addition
2. Subtraction
3. Multiplication
4. Division
Your choice? 3
Enter the first number? 4
Enter the second number? 5
4 multiplied by 5 is 20
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