arrays and structure. issues

The question is commented out on the program but it is what I am trying to get done. The problems I am having are the name doesnt show when the account number is entered And when I put the account number in this is what I get.
enter your account Number? 101
Balance is 1

Process returned 0 (0x0) execution time : 15.111 s
Press any key to continue.
It does this for each one of the 5 If I type in account 102 it gives me a balance of 2 ?? Im confused .


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>
    using namespace std;

    /**
     *  You are developing a BankAccount structure for Parkville Bank. The structure contains

fields for the account number, the account balance, and the annual interest rate earned on
the account. Write a main()function in which you create an array of five BankAccount
objects. Prompt the user for values for all the fields in the five BankAccounts. Do not
allow two or more accounts to have the same account number. After all the objects have
been entered:
» Display all the data for all five accounts.
» Display the total balance in all five accounts and the average balance.
» After displaying the statistics, prompt the user for an account number and display the
data for the requested account, or display an appropriate message if no such account
number exists. Continue to prompt the user for account numbers until an appropriate
sentinel value is entered.

Submit your code and scrrenshot of your code working all in a word dcument 

For full grade you will need to submit by the due date.
    
     */

	int main()
{
        char Acctlogin;
        char acctNumber;
        char beginingBalance;
            cout << " enter your account Number? ";
            cin >> Acctlogin;
            cin >> acctNumber;
            cin >> beginingBalance;
        if(acctNumber == Acctlogin)
            cout << "Account Number invalid, Please re-enter Your Account Number" << endl;
	else
            cout << "Balance is " << beginingBalance <<  endl;

	return 0;

}

    struct CheckingAccount

{
    string name;
    int acctNumber;
    double beginingBalance ;
    double beginningBalance;
    double totalCheck;
    double totBalance;




};
CheckingAccount personalAccount[5];
    void manageAccount()
{
    personalAccount[0].name = "Nissan";
    personalAccount[0].acctNumber = 101;
    personalAccount[0].beginingBalance = 100.00;


    personalAccount[1].name = "Buick";
    personalAccount[1].acctNumber = 102;
    personalAccount[1].beginingBalance = 200.00;


	personalAccount[2].name = "Chevy";
    personalAccount[2].acctNumber = 103;
    personalAccount[2].beginingBalance = 300.00;


	personalAccount[3].name = "Ford";
    personalAccount[3].acctNumber = 104;
    personalAccount[3].beginingBalance = 400.00;


	personalAccount[4].name = "AMC";
    personalAccount[4].acctNumber = 105;
    personalAccount[4].beginingBalance = 500.00;


	cout <<" 1 Name" <<personalAccount[0].name << endl;
    cout <<" 1 acctnumber" <<personalAccount[0].acctNumber << endl;
    cout <<" 1 beginingBalance" <<personalAccount[0].beginingBalance << endl;


	cout <<" 2 Name"<<personalAccount[1].name << endl;
    cout <<" 2 acctnumber"<<personalAccount[1].acctNumber << endl;
    cout <<" 2 beginingBalance"<<personalAccount[1].beginingBalance << endl;


	cout <<" 3 Name"<<personalAccount[2].name << endl;
    cout <<" 3 acctnumber"<<personalAccount[2].acctNumber << endl;
    cout <<" 3 beginingBalance"<<personalAccount[2].beginingBalance << endl;


	cout <<" 4 Name"<<personalAccount[3].name << endl;
    cout <<" 4 acctnumber"<<personalAccount[3].acctNumber << endl;
    cout <<" 4 beginingBalance"<<personalAccount[3].beginingBalance << endl;


    cout <<" 5 Name"<<personalAccount[4].name << endl;
    cout <<" 5 acctnumber"<<personalAccount[4].acctNumber << endl;
    cout <<" 5 beginingBalance"<<personalAccount[4].beginingBalance << endl;
Last edited on
any idea's at all ? I need to turn this in today and I am really looking for someone to point me in the correct direction... Where do you see I might have messed up ? please help
It looks like the rest of your program got chopped off.

By the way, you should really learn to use loops so you don't have so much duplicated code:
http://www.cplusplus.com/doc/tutorial/control/#for
Topic archived. No new replies allowed.