WRITE FLOWCHART AND PSEUDOCODE ONLY (C++)
Write the flowchart and pseudocode for the following
program (but not the program itself.)
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. (
sidea2 = sideb2 + sidec2 / sideb2 = sidea2 + sidec2 /
…..)
The program will read three side lengths from a text file, and then print the lengths along with a message stating if the triangle is a right triangle. (Remember the side lengths may be in any order in the file.) Name your file Lab5B.
#include <iostream>
using namespace std;
int main()
{
float a,b,c,side1,side2,side3;
cout<<"Enter side1:";
cin>>a;
cout<<"Enter side2:";
cin>>b;
cout<<"Enter side3:";
cin>>c;
side1=a*a;
side2=b*b;
side3=c*c;
if(side1==side2+side3){
cout<<"The triangle is a right triangle";
}
else{
cout<<"The triangle is not a right
triangle";
}
}
Get Answers For Free
Most questions answered within 1 hours.