Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Heres the Bash script that creates an array of shapes prompts the user to select one and calculates ...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