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

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




Saving

 
Reply to this topicStart new topic

Saving, save 1000,- pr month

mroizono
26 Nov, 2007 - 01:28 AM
Post #1

New D.I.C Head
*

Joined: 16 Nov, 2007
Posts: 11


My Contributions
hello
I am just for fun going to try to code a program for saving monny in a bank.
I am going to save 1000,- pr month in my saving account.
Intrest:
0 - 50000 = 2.2%
50000- 200000 = 3.2%
200000 - 500000 = 4.9%
For 40 years.

CODE

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    double input, mnd, total;
    double delsum;
    double sum;
    double intrest=2.2;
    input=1000;
    
    for(mnd=12; mnd<=480; mnd++)
    {
        delsum= (input*mnd*intrest)/100; //this is intrest pr year.
        total= delsum+(input*mnd);
        cout<<total << "\n";
                 
        }
                

          system("PAUSE");
    return EXIT_SUCCESS;

}


This is not all the program, but this loop do not give me the right answer.
I have solved this in MS Excel and the ansver is 768 522,58,- this is with intrest of 2.2 for 40 years.
Can annyone help to direct me going the right way?
Thanks

MrOizO
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 09:27PM

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