1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
int functions::collectInput()
{
// my functions.cpp file
int a1,b1,c1,a2,b2,c2,x = 0;
cout<<"please enter three numbers seperated by spaces. these will be the A,B,C values\n"
"for your first quadratic equation."<<endl;
cin>>a1;
cin>>b1;
cin>>c1;
if(!cin.good())
{
cout<<"Bad number, please try again."<<endl;
exit;
}
cout<<"please enter three numbers seperated by spaces. these will be the A,B,C values\n"
"for your SECOND quadratic equation."<<endl;
cin>>a2;
cin>>b2;
cin>>c2;
if(!cin.good())
{
cout<<"Bad number, please try again"<<endl;
exit;
}
cout<<"enter an 'x' value for both quadratic equations"<<endl;
cin>>x;
if(!cin.good())
{
cout<<"Bad number, please try again"<<endl;
exit;
}
}
|