Hi All , hope you are having a nice day
Please if you have time please look at this code and tell me what is going
wrong all it is supposed to do is get the user to enter the quoted char,int
and float check they have input the correct data then output the data but
the float check cocks up please tell me why.
heres the code---->snip><
/* (CHAP2A.CPP)
//*******************************************************************
//* chap2x3.cpp
//* Programmer: Michael Rathburn
//* Date
//* Version 1
//*******************************************************************
#include
#include
#include
#include
char ch;
int number;
float pi;
void main()
{
clrscr();
while (1)
{
cout << "\n\tPlease enter the letter A ";
cin >> ch;
if (ch != 'A')
{
cout << "\n\tWrong Letter";
continue;
}
else
cout << "\n\tPlease enter 21 ";
cin >> number;
if (number != 21)
{
cout << "\n\tWrong Integer";
continue;
}
else
cout << "\n\tPlease enter pi ie:-3.142 ";
cin >> pi;
if(pi 3.142 )
{
cout << "\n\tWrong Formula";
continue;
}
else
cout << "\n\tYou entered the letter " << ch;
cout << "\n\tYou entered the number " << number;
cout << setiosflags(ios::fixed)
<< setiosflags(ios::showpoint)
<< setprecision(3)
<< setw(5);
cout << "\n\tYou Entered pi " << pi;
break;
}
cout <<"\n\n\n\n\t\t\t\tGoodbye!";
}
*/
-=> Yours sincerely, Michael Rathburn <=-
--- Terminate 5.00 UnReg
---------------
* Origin: When did you last warm yourself with a Terminate! (2:250/124.19)
|