Company: Intuit_17_jan
Difficulty: medium
Bash: Descriptive Calculator Problem Description In text-based instructions, arithmetic operations are often described with words mixed among numbers, so the relevant data has to be extracted from the sentence before the calculation can be done. Write a Bash script that reads lines of text. Each line contains one arithmetic instruction made of an operator keyword ( sum , difference , multiply or divide ) followed by two integers, num1 and num2 , with unrelated words around and between them. For each line the script must: identify the operator and the two integers, ignoring every unrelated word; perform the operation on the two integers, in the order they appear in the line; print the result. Complete the function perform_operation with the following parameter: line : a string that contains the operator followed by two integers It prints the integer result of the operation. The provided main reads the input and calls perform_operation once per line. The operations are: sum : num1 + num2