can someone to help me with this calculator? i want the user to be able the press A for add and B for subtract etc. how would i do that? am using BASH
HERE IS MY CODES SO FAR:
echo "choose from the menu :
(A) Add
(B) Subtract
(C) Multiply
(D) Divide
(E) Modulus
(F) Exponentiation
(G) Exit" menu
echo "Choose a letter between A-F or G to exit"
read -p "Enter a operand letter : " letter
read -p "Enter your first number : " num1
read -p "Enter a second number : " num2
----------------
Choose a-g:
a...adding
.......
e...modulus
f...exponentiation
g...exit
Enter a letter: a
-----------------
ADDING
Enter two numbers: 2 15
2 + 15 = 17
----------------
Choose a-g:
a...adding
.......
e...modulus
f...exponentiation
g...exit
Enter a letter: e
-----------------
MODULUS
Enter two numbers: 19 7
19 % 7 = 5
----------------
Choose a-g:
a...adding
.......
e...modulus
f...exponentiation
g...exit
Enter a letter: f
-----------------
EXPONENTIATION
Enter two numbers: 3 5
3 ^ 5 = 243
----------------
Choose a-g:
a...adding
.......
e...modulus
f...exponentiation
g...exit
Enter a letter: g
-----------------
EXIT