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

Username:   Password: 
 RegisterRegister   
 Help Making a Turing Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RyGuy176




PostPosted: 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>
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
RyGuy176




PostPosted: 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
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: