I can not enter dollar amounts with decimals at chk amt. I can't use float or double chk[SIZE] instead of int chk[SIZE]. What can I do?
#include <iostream.h>
#include <math.h>
#include <iomanip.h>
//Lyanette Scott CIS120
int main()
{
float b;
const int SIZE=100;
int chk[SIZE];
float dep;
int totchk=0;
int numchk;
float nbal;
cout << " Program to compute simple interest an amount\n"<< endl;
cout << "Enter the amount of the deposit ( no $ or comma)"<< endl;
cin >> dep;
cout <<"Beginning balance" << endl;
cin>> b;
cout <<"How many checks for deposit" << endl;
cin>> numchk;
for (int i=1; i<=numchk; ++i)
{
cout<< "chk amt (enter zero when complete)"<<i<< ":" ;//checks
cin >> chk[i];
totchk += chk[i];
if (chk[i]==0) goto next;
}
next:cout << "Total amt in Checks: \t$"<<totchk<<endl;
nbal=(b+dep)-(totchk+30);
cout << "Available balance: \t$"<< nbal<< endl;
return 0;
}
Please
HELP!!!!!!!!