Wednesday, July 18, 2012

Quiz 1 Midterm

Every savings account has an associated interest rate, and annually (assuming we have an annual rate), the rate is multiplied with the current balance to get the amount earned as interest. The amount is added to the current balance to get the new balance

For Example, suppose we have an initial balance of Php 100,000.00 deposited at an interest rate of 10% . After one year, the savings account earns Php 10, 000.00(that's 10% of P100,000.00), so the new balance would be Php 110,000.00 after another year it earns Php 11,000.00 (10% of Php 110,000.00) and the balance would be Php 121,000.00. Another year would make it Php 133,100.00 (Php 121,000.00 + Php 12,100.00)

For your miderm Quiz1 using FILE, write a program that outputs the interest earned and balanace of savings account each year for several years. The program prompts for the following values:

  1. Initial balance

  2. Interest rate, in decimal

  3. Year deposited

  4. Year to be withdrawn

Below is the sample output

Input balance: 100000

and interest rate: 0.10

Input initial year: 1997

Input final year: 2010











You'll need to use loop here.

The output must display in the file name: Account.txt





No comments:

Followers

Visitor

free counters

FEEDJIT Live Traffic Feed