Question: Write MARIE instructions: A controller with a camera examines triangular parts on a conveyor belt of a manufacturing process. Depending on the triangular shape of
Write MARIE instructions:
A controller with a camera examines triangular parts on a conveyor belt of a manufacturing process. Depending on the triangular shape of the part, it instructs the conveyor to route the part to a certain destination.
To simulate its decision process, create a MARIE program that will allow the user to enter three integers, representing the lengths of the sides of a triangle.
The program should display the three input values received and then respond with a conclusion identifying the type of triangle these sides will form.
The MARIE program should give the user the answer (Output) and be ready for the user to enter another set of 3 numbers. So, the program will have to clean up after itself and be ready to start on the next input set from the user.
To form a triangle, the length of any side must be less than the sum of the other two sides. For example, sides of 1, 2, and 4 do not form a triangle. If the three numbers do not form a triangle, inform the user via an error code.
Triangles are classified by the number of sides they have of matching length: 3 is "equilateral"; 2 is "isosceles"; none is "scalene".
The program should gracefully handle any bad data, such as one side with a zero value.
Negative numbers in input are NOT bad data. The camera subsystem can give a negative value depending on the direction of the side of the part. For the routing function, use the positive magnitude of any negative input received.
Halt the program when the user enters three zeros as the input values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
