Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 err? looping formula error?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JustTrying2GetBy




PostPosted: Fri Nov 05, 2004 1:09 am   Post subject: err? looping formula error?

code:

const interest_rate := 0.115
const payment := 8600
var mortgage : int := 85000
var b : int := 0
var interest, balance : real

put "Year", " " : 10, "Interest", " " : 10, "Balance"

loop
    interest := mortgage * interest_rate
    balance := mortgage + interest - payment
    b := b + 1
    put b, " " : 13, "$ ", interest, " " : 11, "$ ", balance
    exit when b = 15
end loop


too tired to think...something wrong with my formula or sumthing...(the balance is soupposed to increase with every year of payment). first interest increasement shows up 0........starting mortgage-$85,000 annual intrest rate - 11.5%, payments are $8600/yr. Intrest is addded before payments are deducted.

how do i fix problem Question
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Fri Nov 05, 2004 12:52 pm   Post subject: (No subject)

You need to change the value of the mortgage! It's no use calculating the interest if you're not going to add it to the mortgage.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: