can anyone tell me what is wrong with my code?
using namespace std;
float previous_balance ;
float payments ;
float charges ;
for (int counter=0; counter<6; counter++)
cout<<"Enter the last name for the "<<counter+1<<" customer."<<endl;
cout<<"Enter the previous balance for customer "<<name[counter]<<endl;
cout<<"Cannot contain letters."<<endl;
sorry that the code looks abit messy. What I do not understand is, why it give me this when I typed a letter for cin>>previous_balance
Enter the last name for the ... customer
it will just flood the screen and keep repeating the same sentence above. I know that previous balance is a float, but i am just checking it to make sure it is really entered as a float. I have tried putting cin.get(): before every cin. However, it still give me the same problem.