Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,940 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,424 people online right now. Registration is fast and FREE... Join Now!




deposit

 
Reply to this topicStart new topic

deposit, interest compound

inneed
11 Dec, 2007 - 05:09 AM
Post #1

New D.I.C Head
*

Joined: 6 Dec, 2007
Posts: 9


My Contributions
#include <iostream.h>

int main()
{
int Years=0;
double Worth=0;
double Interest=0;
cout << "--Calculate the number of years for $2500 to compound to $5000--\n";
while (Worth < 5000) {
Years++;
Interest=1;
for (Counter=1; Counter<Years; Counter++)
{
Interest=(1.075*Interest);
}
Worth = 2500*(Interest);
}
cout << "It will take " << Years << " years to compound to $5000.";
return(0);
}

for some reason it's wrong...
the directions say:
Your deposit $2500.00 in a new super certificate of deposit (CD) at your bank. write a ptogram to calculate how many years it will take for your CD yo be worth 5000.00 or more, if it pays 7.5% interest compounded annually.
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Deposit
11 Dec, 2007 - 05:17 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,353



Thanked: 51 times
Dream Kudos: 25
My Contributions
Can you specify by what you mean by wrong? Are you getting compiler errors? Unexpected results?
User is online!Profile CardPM
+Quote Post

inneed
RE: Deposit
11 Dec, 2007 - 01:08 PM
Post #3

New D.I.C Head
*

Joined: 6 Dec, 2007
Posts: 9


My Contributions
QUOTE(Amadeus @ 11 Dec, 2007 - 06:17 AM) *

Can you specify by what you mean by wrong? Are you getting compiler errors? Unexpected results?



never mind i got it1!!!!! thanks anyways.

User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 04:41PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month