Hey everyone, I'm trying to write a simple program that allows the user to input and Amount, Yearly Interest Rate, and a Final Amount. The program is to compute how long the money should be invested to end up with the Final Amount if it is compounded monthly. I'm just learning how to program in C++ so any help is greatly appreciated. I got the basic computations I think but I don't know whether to use a For-Loop or a While-Loop...Please help! Thanks!!
jakestr15
0
Newbie Poster
Recommended Answers
Jump to PostUsing a while loop would be a better option.
If you want more help then please post your entire code so that we can help you out.
Jump to Postdo{
blah blah blah
}
while (yearcount!=5)
That should help you a little.Unless I missed something, the loop will go as long as
amount < famount
, assuming amount is updated to store the amount after a given time period.
All 5 Replies
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
jakestr15
0
Newbie Poster
Harkua
0
Newbie Poster
jakestr15
0
Newbie Poster
Infarction
503
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.