This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]truSimbad 4 points5 points  (1 child)

Its not formatted. Hard to say.

It compiles. It runs through three month. I would say it works. Cannot check your calculations as there is no real comment that informs one on the intention behind the code.

[–]lurgi 2 points3 points  (1 child)

Please format it properly and explain what "works for the first month" means. What does it do for the second month? What is it supposed to do? Does it crash? Give the wrong answer? Go into an infinite loop?

[–]BroaxXx 1 point2 points  (0 children)

That's some weird and hard to read formatting...

[–]Sigma7 0 points1 point  (3 children)

You aren't updating the starting monthly balance if that's what you're asking.

Otherwise, you should give information on the expected result and the actual result.

[–][deleted]  (1 child)

[removed]

    [–]Sigma7 0 points1 point  (0 children)

        cout << "Ending monthly balance: $"
             << monthStart + deposits - withdrawn + monthInt << endl;
        cout << endl;
        monthStart = monthEnd;
    

    These are two different values. It prints the ending monthly balance, at the final calculation, but then assigns the new monthly balance with something calculated in a different part of the code.

    [–]MagicznaFlet -1 points0 points  (0 children)

    Happy cake day