Need to see if im on right track

Hey Yall trying to make a Bank account program. I want to see if im on the right track. Also I wanna see how can I add on to the Balance. Its not close to being finished ,but just check it out. Im also going to get into inheritance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 #include <iostream>
#include <iomanip>
#include <string>
#include <cstring>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
//Create an Balance that updates.
//Make an working interest rate.
//Create an online login id.
//Use Inhertiance
// UPDATING BALANCE
//Don't forget to try to make Balance a class of it's own if BankAccount don't work.
// Try using Vectors maybe.
//If get frustrated headbutt something hopefully I will wake up a Savant and understand everything.
using namespace std;
class BankAccount
{

public:
  BankAccount();
    void SetWithdrawl(double BankaccountWithDrawl);
    void SetChecking(double BankAccountChecking);
    void SetSaving(double BankAccountSaving);
    void SetBalance(double BankAccountBalance);
    double GetChecking();
    double GetSaving();
    double GetWithdrawl();
    double GetBalance();


private:
    double checking;
    double saving;
    double Withdrawl;
     double Balance;

};
BankAccount::BankAccount()
{
    checking =0;
    saving = 0;
    Withdrawl = 0;
    Balance = 0;
}
void BankAccount::SetWithdrawl(double BankAccountWithdrawl)
{
    Withdrawl = BankAccountWithdrawl;


}
void BankAccount::SetChecking(double BankAccountChecking)
{
checking = BankAccountChecking;
}
void BankAccount::SetSaving(double BankAccountSaving)
    {

      saving=BankAccountSaving;

   }
 double BankAccount::GetChecking()
   {
       return checking;
   }
 double BankAccount::GetSaving()
 {
     return saving;
 }
 double BankAccount::GetWithdrawl()
 {
     return Withdrawl;
 }
 void BankAccount::SetBalance(double BankAccountBalance)
 {
     Balance=GetBalance();
 }
 double BankAccount::GetBalance()
 {
     return Balance;
 }
 void MenuScreen()
 {
    cout << "WELCOME TO BANK OF BOOMBOOMBEEBEE/n ";
    cout << "--------1 Make A WithDrawl--------/n";
   cout <<  "--------2 ADD OR SEE Your Savings------/n";
    cout << "--------3 See Checkings account-----/n";
    cout << "--------4 See your Balance--------/n";
 }
int main()
{
   int Itemmenu;
   int InputBalance;
  BankAccount gg;

if (gg.GetBalance() = 0)
{
    cout << "Please enter a starting Balance" << endl;
    cin >> InputBalance;
}
     MenuScreen();
    switch (Itemmenu);
case 1:
break;
cin.ignore();
}
looks good..why would you want to make balance a class?
closed account (48T7M4Gy)
Withdrawal not Withdrawl

It would be better to decide what makes up one account and work on that rather than intermingling all types of account. This means an account class which would just have a balance (property) with ability to deposit, withdraw and check the balance (methods).

So, what this means is you create a checking account object, savings account object etc and take it from there. This is much simpler than just creating one object (gg) and trying to manipulate that one and only one object.
Last edited on
Topic archived. No new replies allowed.