white a program that determines if 3 numbers that are entered, by the user, are sides of aright triangle.
remember any combination of numbers can be entered, 3 4 5,5 43, 435… are all the
same right triangle.
you must have a function that does exponentiation,
one that does input of 1 number one that does output.
and one that does the comparisons
the main will be this code
main:
jal allwork
li $v0,10
syscall
function allwork will call function input which will ask the user for a single number,
input will call function pow which will square the number that was entered (it must work with
any exponent >=0)
allwork will also call function check, which will check if these numbers are those of a right
triangle,
some of these functions will be called more than once
you will need the stack to manage the nested functions, and their return address’
there can only be 1occurrence of syscall with a value of 4, and only 1 occurrence of a
syscall of value 5 in the program
name your program lastNameProj3.asm (mine would be lichtenthalProj3.asm)or it will not be
graded
sample runs
Enter value for side A: 5
Enter value for side B: 4
Enter value for side C: 3
5, 4, 3
is a right triangle
program is finished running
—
Enter value for side A: 3
Enter value for side B: 5
Enter value for side C: 4
3, 5, 4- is a right triangle
program is finished running
Enter value for side A: 3
side B: 3
Enter value for
Enter value for side C: 6
3, 3, 6
is not a right triangle
program is finished running
Enter value for side A: 15
Enter value for side B: 8
Enter value for side C: 17
15, 8, 17 is a right triangle
–
program is finished running