Question: Write a bash script that creates an array of shapes - square, rectangle, triangle, and circle. The script prompts the user to enter to

 Write a bash script that creates an array of shapes-square, rectangle, triangle, and circle. The script 

Write a bash script that creates an array of shapes - square, rectangle, triangle, and circle. The script prompts the user to enter to select one of these shapes. Based on the shape, it should prompt the user for the necessary value to calculate the area of the shape selected. The script should then display the value calculated. (Use: 3.14 for pi) Area of Square= side = side x side Area of Rectangle = length x width 1 Area of Triangle = = x base x height Area of Circle = xr = xr xr The interface should be as follows: Enter a shape [square, rectangle, triangle, and circle]: square Enter the measurement of the side: 8 Area of square = 64 Enter a shape [square, rectangle, triangle, and circle]: rectangle Enter the measurement of the length: 8 Enter the measurement of the width: 3 Area of square= 24

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the Bash script that creates an array of shapes prompts the user to select one and calculates ... View full answer

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