Help Making a Turing Program
Author |
Message |
RyGuy176
|
Posted: Tue Feb 26, 2013 1:45 pm Post subject: Help Making a Turing Program |
|
|
I am trying to make a program in Turing that will compute the bank balance at the end of each year for 10 years resulting from an initial deposit of $1000 and an annual interest rate of 6% (Compound Interest) and give the Output for each year end the number of the year, the initial balance, the interest for the year, and the balance at the end of the year
<>
I have the formula but I can't figure out how to get Turing to add the numbers up. I give it the number 10 for total years but it does only one equation with it.
<Answer Here>
I'm new to Turing so i'm still trying to figure out somethings, but just can't seem to get the hang of the math in it, and no online tutorials have helped. Below is the code that me and my co-creator have written.
Turing: |
/*
Programmer: Ryan Sweanor & Alex Graham
Title: Interest-ing Tax Calculator
Date: February 26, 2013
Description: This program finds the annual amount of tax if you have $1000
in the bank and you add 6% each Year
*/
% Variables
var principal, final_answer, rate, Year, balance, superbalance : real
% Input
put "Please enter the principal amount of money (In this case $1000) " ..
get principal
cls % Clears this line from visability
put "Please enter the amount of interest rate (6% or 0.06) " ..
get rate
cls
put "Please enter the time in Year (10) " ..
get Year
cls
% Process
final_answer := principal * rate * Year %Finds how much interest your getting
balance := final_answer + principal % Finds out how much money is in the bank total
superbalance := balance * Year % All the money after the amount of Year
% Output
put "Year" : 20, "Initial" : 20, "Interest" : 20, "Year End" : 20
for year : 1 .. 10
put year : 3, "" : 15, "$", principal : 10 : 2, "" : 10, rate : 10 : 2, "" : 10, "$", final_answer : 10 : 2
end for
|
I am Using Turing 4.1.1
<Answer Here> |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Tue Feb 26, 2013 2:26 pm Post subject: RE:Help Making a Turing Program |
|
|
How are the printed values supposed to change from year to year? Where in the program are you changing the values in such a way? |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
RyGuy176
|
Posted: Thu Feb 28, 2013 1:15 pm Post subject: Re: Help Making a Turing Program |
|
|
I couldn't figure that out. That's why I need help |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Thu Feb 28, 2013 1:28 pm Post subject: Re: Help Making a Turing Program |
|
|
I thought that...
RyGuy176 @ Tue Feb 26, 2013 1:45 pm wrote: I have the formula
forget about Turing for a moment, and explain to me how I would use the formula. Consider that I can do basic math very well, but otherwise will make no assumptions about the instructions given. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|