Question: Write a script that will act as a simple calculator for add, subtract, multiply, and divide; each operations should be in a function of its

Write a script that will act as a simple calculator for add, subtract, multiply, and divide; each operations should be in a function of its own. Any of the three methods for bash arithmetic, let, expr or $((..)), may be used. The user should pass as an argument on the command line a letter (a, s, m or d) and two numbers. The letter will be used to determine which operation will be performed on the two numbers entered. If one or more of the three parameters is left out, then display a usage message. Finally display the answers. This script should be called calculator.

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 Databases Questions!