This is my code and I was wondering if it matched my pseudocode and if not how would I rearrange it to do so and any improvements I could make. The code works just wondering if it needs to be rearranged/improved. Any help is appreciated :)
--CODE--
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
cout << "Enter Batch No. :- "; // This is were we enter the Batch code no. cin >> batch;
while (batch != "0")
{
cout << "Enter Dimension A :-"; // At this stage we obtain Dimension A, B & C from the user. cin >> DimA;
cout << "Enter Dimension B :-";
cin >> DimB;
cout << "Enter Dimension C :-";
cin >> DimC;
if (DimA <= DimB || DimA <= DimC) // This calculates if Dimension A is indeed the longest (or biggest). {
cout << "Invalid Data"; // If DimensionA is not longest report error to user - "Invalid Data". std::cin.ignore(INT_MAX);
cin.get(); // This code is here as once you input Dimension C the program would close. }
else
if (check_Pythag(DimA, DimB, DimC) == 'Yes'){
cout << endl << "Batch No. " << batch << " is Right Angled";
cout << endl << endl;
}
else
{
cout << endl << "Batch No. " << batch << " is not Right Angled";
cout << endl << endl;
}
cout << "Enter Another Batch No. (101 to exit) :- ";
cin >> batch;
}
}
--PSEUDOCODE--
module Main()
begin
get Batch code
while Batch code is greater than blank
get DimensionA
get DimensionB
get DimensionC
if DimensionA is not longest