Computer Science Canada

How to put this into chart form?

Author:  BobTheRobot [ Mon Dec 01, 2014 9:41 am ]
Post subject:  How to put this into chart form?

What is it you are trying to achieve?
How do i put this piece of code into chart form.


What is the problem you are having?
<I either get the same thing that just repeats or a bunch of negative numbers>


Describe what you have tried to solve this problem
<for month:1..maxint
put month:5,monthlypayment:20,monthlyinterest:30,mortgageAmount:50>
i put something like that previously. "Month just took over the program and continued by itself or it'd just stay at 1


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<var housecost, downpayment, mortgageAmount, mortgageAmount1, interestrate, monthlypayment, monthlypayment1, biweeklypayment, amortizationperiod, annualinterest : real
var monthlyinterest1 : real
var reply : string

put "House Cost: " ..
get housecost
put "Mortgage Amount: " ..
get mortgageAmount
put "Enter enterest rate in decimal form  (example:3%=0.03)"
put "Interest Rate: " ..
get interestrate

%-------------------------------------------------------------------------------
%THIS IN CHART FORM
put "Enter the amount you will be paying per month"
get monthlypayment

color (55)
loop
    var monthlyinterest : real := (mortgageAmount * interestrate) / 12
    put "Monthly interest: ", monthlyinterest
    monthlypayment := monthlypayment + monthlyinterest
    put "Paid: ", monthlypayment
    mortgageAmount := mortgageAmount - monthlypayment
   
    put monthlypayment:10,mortgageAmount:20
 
    if mortgageAmount < monthlypayment then
        put "Last Payment: ", mortgageAmount
        put "Left:0"
        color (31)
    end if
   
    if mortgageAmount < 0 then
        put " "
    end if
   
    put "Left: ", mortgageAmount
    exit when mortgageAmount <= 0
    end loop
   color (55)
%--------------------------------------------------------------------------------->



Please specify what version of Turing you are using
<4.1.2>


: