I keep geting a error in line 25 saying identifier expected but i cant figure it out for the life of me, can anyone help me out. C++ code btw. Line 25 is at the end of the class. Similar google errors have said that its missing a simicolen or } but i dont see anything.
Code:#ifndef Account #define Account #include <iostream> #include <string> #include <sstream> using namespace std; class Account { private: string ownerFirstName; string ownerLastName; float balance; float deposit; float withdraw; public: account(); account(string f, string l, float b, float d, float w); void depositFunds(float d); void withdrawFunds(float w); float getBalance(); }; Account::Account() { ownerFirstName = Jhon; ownerLastName = Doe; balance = 2000; } Account::Account(string f, string l, float b, float w) { ownerFirstName = f; ownerLastName = l; balance = b; deposit = d; withdraw = w; } void Account::depositFunds(float d) { cout << "How much would you like to deposit today: "; cin >> deposit; int total = balance + deposit; cout << "You deposited", deposit," dollars." <<endl; cout << "Current Total is", total," dollars." <<endl; cout << " " << endl; } void Account::withdrawFunds(float w) { cout << "How much would you like to withdraw: "; cin >> withdraw; int total2 = balance - withdraw; cout << "You withdrew", withdraw, " dollars." <<endl; cout << " Current Total is", total2," dollars." <<endl; cout << " " << endl; } float Account::getBalance() { cout << "Current account balance is", balance," dollars." << endl; cout << " " << endl; } void main() { int choice = 0; while choice !=4; { cout << "What would you like to do"<< endl; cout << "1) Display Current Account Balance" <<endl; cout << "2) Deposit Money" <<endl; cout << "3) Withdraw Money"<< endl; cout << "4) Exit" << endl; cout << "Please make a selection: "; cin choice; } while choice !=5; { switch(choice) { case '1': cout << Account.getBalance(); break; case '2': cout <<Account.depositFunds(); break; case '3': cout <<Account.withdrawFunds(); default: cout << "Thank you for using our serivice"<<endl; cout << "Goodbye" << endl; } } } #endif
XI Wiki


