Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help me complete this assignment: In this assignment, you will write a bash script called tsp which will classify a triangle. It will lake,
please help me complete this assignment:
In this assignment, you will write a bash script called tsp which will classify a triangle. It will lake, as command-line arguments, the lengths of the three sides of a triangle, and classify the triangle as exactly one of. Right A 90 degree angle, per the Pythagorean Theorem: a^2 + b^2 = c^2. Equilateral: All three sides are the same length Isosceles: Two sides, but not three, are the same length. Scalene: No sides are the same length. Not a triangle: For example, lengths of 1, 2, and 9. They just don't fit together! Testing Here are some of the ways that we will test your program. You can try your program with these arguments, and fix any problems you may have, or you can wait and let us find your problems. Your grade will reflect your choice. Here are some bad inputs, which must generate only an error message. Requirements Your program should emit a helpful error message if too many or too few arguments are given any argument is not an integer (a whole number) greaterthanorequalto 1 I haven't told you precisely what the output should look like, and I haven't told you precisely what a helpful error message would be. Figuring that out is part of the assignment. If your program emits an error message, it should not emit anything else. For example, given the arguments it would be wrong for the program to complain about the arguments not being greaterthanorequalto 1, and then go on to declare this an equilateral triangle In cases where multiple requirements are violated, say for the two arguments Fish theta, it doesn't matter which requirement you complain about. Pick one, complain, and that should be all This must be a pure bash script, and not use any other languages such as perl awk. You may use programs such as sed or Don't be concerned about leading zeroes in numbers. They are used by bash to indicate octal (base 8). We will not test your program with leading zeroes The first line of your script must be 1 bin/bash Your script must include a comment block after the first line that contains: your name, course, assignment, and dateStep by Step Solution
There are 3 Steps involved in it
Step: 1
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