In a right triangle, the square of the length of one side is equal to the sum of
ID: 3655585 • Letter: I
Question
In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sides. Stephanie has the integer lengths of three sides of a triangle and needs to know if it is a right triangle. Write a C++ program to solve this problem. 4. Identify five significant test cases including one for incorrect input (ie. Input a letter rather than a digit for the numeric input). (Think about what impact changing the order of the input values should have on your program!) For each of the five test cases show what inputs you will use and calculate what your expected outputs should be I need a program that doesnt lock up when a letter is mistakenly typed instead of a number, as in the question #4 scenario.Explanation / Answer
/*you may also download the code from......http://www.2shared.com/file/kqq6U9hB/RIGHTTRI.html*/ #include#include#include#include#include#define boolean int #define true 1 #define false 0 boolean check(char* val) { int x=0,result; int flag=0; while(val[x]!='') { result=isdigit(val[x]); if(result==0) { flag=1; break; } x++; } if(flag==0) return true; else return false; } void main() { int i; char a[5],b[5],c[5]; int valA,valB,valC; boolean status; clrscr(); for(i=1;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.