Error..not sure what I'm doing wrong

This is what I need to do: get 5 amounts, display & add a $10 fee if the amount is more than $500. This is what I have to far, but I keep getting error: "cannot convert 'double*' to 'double' in assignment"

This is the code I have to far:

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
  int main()
{
    double acctBal[5];
    
    for (int i = 0; i < 5; i = i + 1)
    {
    	acctBal[i] = 0.0;
    }
               
    cout << "You will be asked to enter the balance of 5 saving accounts."<< endl;
    cout << "Enter balance of an account: "<< endl;
    for (int i = 0; i < 5; i = i + 1)
    {
 	    cout << "Enter balance of an account: ";
    	cin >> acctBal[i];
    }
    cout << endl;
 
    cout << "Balances entered are: "<< endl;
    for (int i = 0; i < 5; i = i + 1)
    {
    	cout << acctBal[i] << endl;
    }
               
    for (int i = 0; i < 500; i = i + 1)
    {
  	    acctBal[i] = acctBal + 10;
    }
    cout << endl;
 
    cout << "Apply $10 fee for accounts with balance below $500. "<< endl;
    cout << "New Balances: " << endl;
    for (int i = 0; i < 10; i = i + 1)
    {
        cout << acctBal[i] << endl;
    }
 
    system("pause");
    return 0;
}



Please advice.
Last edited on
Please copy and paste the exact error message, including the line number.

Speaking of line numbers, edit your post and put code tags around your code to get syntax highlighting. Remember, those things you backspaced when you started a new topic?
Sorry! I'm new in this...Line 27 is what I get the following error:

[Error] cannot convert 'double*' to 'double' in assigment


What does it mean??
It means you forgot the text "[i]" on the second mention of acctBal - you're referring to the whole array instead of just one element.

And, welcome to the forums :) sorry if I came off as annoyed.
Last edited on
I was going over and over the code and was so "blind" he he he!! Thank you for your assistance :)
Topic archived. No new replies allowed.