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

Username:   Password: 
 RegisterRegister   
 can someone help me...
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kid105




PostPosted: Wed Dec 09, 2009 10:03 pm   Post subject: can someone help me...

What is it you are trying to achieve?
write a program which will calculate and print a table showing how a cash investment on term deposit in a bank accumulates over a period of time given a certain compounding period.

the program will ask the user for:

A) cash investment
B) interest rate: entered by user either as a decimal or a percent. programs should convert to decimal if necessary.
C) compounding period: monthly, quarterly, semi-annually, or annually.
D) term of investment: in months



What is the problem you are having?
just guide me through it

Describe what you have tried to solve this problem
its written below

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

var initial_amount, interest_rate, term, interest : int
var compounding_period, M, Q, S, A : string

put "initial amount: $ " ..
get initial_amount
put "interest rate: % " ..
get interest_rate
put "compounded: M,Q,S,A " ..
get compounding_period
put "Term: Months " ..
get term

interest := initial_amount * interest_rate * term

Turing:



var initial_amount, interest_rate, term, interest : int
var compounding_period, M, Q, S, A : string

put "initial amount: $     " ..
get initial_amount
put "interest rate: %      " ..
get interest_rate
put "compounded:  M,Q,S,A   " ..
get compounding_period
put "Term:    Months  " ..
get term

 interest := initial_amount * interest_rate * term



Please specify what version of Turing you are using
any turing
Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Thu Dec 10, 2009 4:07 pm   Post subject: RE:can someone help me...

aah, if i understand properly,

you can't tell the computer to do the math quite the way you have you can not say, intrest= ....


you have to have the computer do the math before, or as you have done it but by removing the intrest variable and

code:

put "your interest is", initial_amount * interest_rate * term




*NOTE*
I am rusty at truing the syntax might be wrong but I am sure the logic is right.
BigBear




PostPosted: Thu Dec 10, 2009 4:16 pm   Post subject: RE:can someone help me...

A = P (1+i)^n

A = Final Amount

P = Initial amount

i = interest rate per compound period

n = number of compound periods

So you need to take the interest rate and divide it by the number of compound periods
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  [ 3 Posts ]
Jump to:   


Style:  
Search: