Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The pseudocode for the problem is:
*Get the inital balance from the user;
*Enter a loop structure
*display a menu
*read the menu choice from the user
*based on the choice (switch or if then else structure)
*execute the code to withdraw, deposit, or write a check, or quit, *based on the choice above
*end loop
_____________________________
My program:

#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
//My name
//Lab XX XX
//December X, XXXX
//Write a program to help balance your money market checking account .
int main()
{
//User must enter the months opening account balance.
int account_balance = 0;                 

cout << "Enter months account balance:" ;
cin >> account_balance;    //need a semi colon at the end of each programming statement

//Program should display a menu to list following choices.
int following_choices ;
cout << "Enter following choices menu:" ;
double following_choices;  
cout << setprecision (2) << setiosflags (ios::fixed) << setiosflags (ios::showpoint);
cout << "Enter the account balance:';
cin  >> "acount_balance;
cout << endl;
cout << "Enter the account balance according to the following" <<endl<<endl;
cout << "Deposit, enter D" << endl;
cout << "Check, enter C" <<endl;
cout << "Withdrawl enter W" <<endl;
cout << "Quit enter Q" << endl << endl;
cout << "Please make your selection.";
cin.get(); //Discard the \n
account_balance = cin.get();
switch (account_balance)
{
case 'D':
case 'd':
    account_deposit = ACCOUNT DEPOSIT;
        break;            //in this branch of the switch, you would ask the user for the amount deposted.
                            // you would then add it to your account balance variable.
case 'C':
case 'c':
    account_check = ACCOUNT CHECK;
        break;
case 'W':
case 'w':
    account_withdrawl = ACCOUNT WITHDRAWL
        break;
case 'Q':
case 'q':
    account_quit = ACCOUNT QUIT
        break;
default:
    cout << endl << endl << invalid account balance! "<<endl;
        exit (1);
    break:
}


it's not finish but the complier says: undeclared identifier after the cases,; starting with C and so forth.
It starts with "account _check"...:confused:
Posted
Updated 18-Dec-09 17:25pm
v3

The compiler is right, of course: the following identifiers are not declared (as required by the programming language):
account_deposit
account_withdrawl
account_quit

:)
 
Share this answer
 
v2
wrote:
cout << "Enter the account balance:';
cin >> "acount_balance;


That should have been:
cout << "Enter the account balance:";
cin  >> acount_balance;


wrote:
cin.get(); //Discard the \n
account_balance = cin.get();


Instead, you could do this:
cout<<"Please make your selection"<<endl;
cin>>account_balance;


wrote:
account_check = ACCOUNT CHECK;


wrote:
account_deposit = ACCOUNT DEPOSIT;


What is ACCOUNT CHECK, ACCOUNT DEPOSIT, etc., defined as?! What are you trying to accomplish by assigning this value to some variable? This doesn't make any sense.


wrote:
cout << endl << endl << invalid account balance! "<<endl;< blockquote="">

And that should be:
cout << endl << endl << "invalid account balance! "<<endl;


If you need to provide clarifications to my query or provide more information, use the message board at the bottom of this page (click on "New Message").
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900