Answered step by step
Verified Expert Solution
Link Copied!

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 

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

1. Let f(x) = 2x+6 if x Answered: 1 week ago

Answered: 1 week ago