I am just beginning to write C++ and have come accross a bug in a simple MS-DOS program. The program is a basic calculator. when it is run and a non-numeric entry is entered into a 'float' field, the text goes haywire and keeps on repeating itself.

Please, Please, Please will somebody help me as this is my first real program. Thank You, Archie

Here is the program, created using Bloodshed Dev-C++:

Code:`#include <iostream>`

using namespace std;

int main()

{

for ( float x = 0; x < 1; x + 0 ) {

float number;

cout<<"CALCULATOR\nArchie Lodge\n\nTo multiply, type '1'\nTo divide, type '2'\nTo add, type '3'\nTo subtract, type '4'\nType number and then press Enter...";

cin>> number;

cin.ignore();

if ( number == 1 ) {//MULTIPLY

float thisisanumber;

float thisisnumbertwo;

cout<<"Please enter the first number to be multiplied: ";

cin>> thisisanumber;

cin.ignore();

cout<<"Please enter the number to multiply the above number by: ";

cin>> thisisnumbertwo;

cin.ignore();

cout<<"The numbers you entered, multiplied together are: "<< thisisanumber * thisisnumbertwo<<"\n";

cout<< thisisanumber <<" times " <<thisisnumbertwo<<" is "<< thisisanumber * thisisnumbertwo<<"\n\nPlease press enter twice to perform another calculation.\n";

cin.get();

}

else if ( number == 2 ) {//DIVIDE

float thisisanumber;

float thisisnumbertwo;

cout<<"Please enter the first number to be divided: ";

cin>> thisisanumber;

cin.ignore();

cout<<"Please enter the number for the above number to be divided by: ";

cin>> thisisnumbertwo;

cin.ignore();

cout<<"The numbers you entered, divided are: "<< thisisanumber / thisisnumbertwo<<"\n";

cout<< thisisanumber <<" divided by " <<thisisnumbertwo<<" is "<< thisisanumber / thisisnumbertwo<<"\n\nPlease press enter twice to perform another calculation.\n";

cin.get();

}

else if ( number == 3 ) {//ADD

float thisisanumber;

float thisisnumbertwo;

cout<<"Please enter the first number to be added: ";

cin>> thisisanumber;

cin.ignore();

cout<<"Please enter the number to add to the above number: ";

cin>> thisisnumbertwo;

cin.ignore();

cout<<"The numbers you entered, added together are: "<< thisisanumber + thisisnumbertwo<<"\n";

cout<< thisisanumber <<" plus " <<thisisnumbertwo<<" is "<< thisisanumber + thisisnumbertwo<<"\n\nPlease press enter twice to perform another calculation.\n";

cin.get();

}

else if ( number == 4 ) {//SUBTRACT

float thisisanumber;

float thisisnumbertwo;

cout<<"Please enter the starting number: ";

cin>> thisisanumber;

cin.ignore();

cout<<"Please enter the number to be subtracted from the above number: ";

cin>> thisisnumbertwo;

cin.ignore();

cout<<"The first number you entered, minus the second number are: "<< thisisanumber - thisisnumbertwo<<"\n";

cout<< thisisanumber <<" minus " <<thisisnumbertwo<<" is "<< thisisanumber - thisisnumbertwo<<"\n\nPlease press enter twice to perform another calculation.\n";

cin.get();

}

else {//ERROR

cout<<"Please enter either 1, 2, 3 or 4. Press enter to continue.\n";

}

cin.get();

}

}