Question: In Unix/Linux: Write a shell script that given a radius, calculates the area of a circle. (Hint dont write this from scratch. Find another script
In Unix/Linux: Write a shell script that given a radius, calculates the area of a circle.
(Hint dont write this from scratch. Find another script that reads user input and performs a calculation, then modify it to meet your needs.)
The formula for calculating the area is: Area=*Radius 2
You can use 3.14 for , and either do Radius*Radius or Radius^2 to get the square of the radius.
Use the scale command to limit the number of decimal points for the area, but do at least two places after the decimal.
You can assume that the user will enter numbers, so you dont have to do any error checking of the input. Your program should allow the user to enter the value for the radius, perform the calculation(s), and then print the output. The output should be a circle that is labeled appropriately.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
