I have never posted to a forum before. I am taking a beginning C++ prgmming class. I am getting the error "error C2181: illegal else without matching if " I have tried everything I can think of to fix it, I can't tell if its a syntax error (such as misplaced ;) or logic error. The following is my code. I've only included the part that is giving me error. I am sorry if this is the wrong place for this post. Please direct me to the correct one and thank you for your help
[
#include <iostream>
#include <iomanip>
//#include <fstream>
using namespace std;
// declare const
const double CHK_SERV_CHRG = 25.00;
const double SAV_SERV_CHRG = 10.00;
const double CHK_ABOVE_MIN_INT = .03;
const double CHK_BELOW_MIN_INT = .05;
int main ()
{
// declare variables
char AcctType;
int AcctNum;
double CurrentBal;
double MinBal;
double OverMinBal;
double Interest = 0;
cout << fixed << showpoint << setprecision(2);
cout << "Enter Bank account number: ";
cin >> AcctNum;
cout << "Enter account type c for checking or s for savings: ";
cin >> AcctType;
cout << "Enter current balance: " << "$ " ;
cin >> CurrentBal;
cout << "Minimum Balance required: " << "$ ";
cin >> MinBal;
cout << endl;
{
if (AcctType == 'c' && CurrentBal < MinBal)
CurrentBal -= CHK_SERV_CHRG;
cout << "Account Number: " << AcctNum << endl;
cout << "Checking account below allowed minimum balance of: " << MinBal << endl;
cout << "Service Charge of: " << "$ " << CHK_SERV_CHRG << endl;
cout << "Current Balance: " << CurrentBal << endl;
}
else
{
Interest = CurrentBal * CHK_ABOVE_MIN_INT;
CurrentBal += Interest;
cout << "Checking account above minimum balance of: " << MinBal << endl;
cout << "Checking account earned the following interest: " << "$ " << Interest << endl;
cout << "Current Balance: " << CurrentBal << endl;
}