Classes giving me hell

Define a class to represent a bank account. include the following members.

Data members

a. Name of depositor
b. Account number
c. type of account(savings or deposit)
d. Balance amount in the account

write member functions to:

a. Assign initial values depending on the type of account(use constructor). Assume initial balance is $500 in the case of savings, $1000 in the case of current account.

b. Deposit an amount and update balance.

c. Withdraw an amount after checking the balance and update balance.If the balance is less than requested amount ask the user to input the withdraw amount again.

d. Display name and Balance.

Write a main program to achieve the above functionalities.

PLEASE HELP ME OUT, I AM JUST LEARNING CLASSES. NEED YOUR HELP DEFINITELY
There's no trick to it. This will get you started.

1
2
3
4
5
6
7
class bankAccount{

string Nameofdepositor;
int  Accountnumber;
int typeofaccount;
int Balance;
};


Read this: www.cplusplus.com/doc/tutorial/classes/
Last edited on
#include <iostream>
#include <string>

using namespace std;

class bankAccount
{
private:
string depositor;
int accNumber;
char accType;
double accBalance;

public:
bankAccount(string, int, char );
void depositUpdate;
void withdraw;
void displayBalance;


this is what i have so far please just show me the rest because i got three questions to do for my assignment. so you helping me with this one i think i can manage the rest
Do you not think that depositUpdate and withdraw should take a parameter? Perhaps the amount of money to withdraw or deposit?
Trust me, i am new to this. please could u write it for me so i can see the steps.
It is policy here not to do your homework for you. We will help you with your code, but if you don't know how to write a function you need to go back to the start.
Topic archived. No new replies allowed.