turing age calculator
Author |
Message |
supermichael0442
|
Posted: Fri Mar 02, 2012 3:03 pm Post subject: turing age calculator |
|
|
What is it you are trying to achieve?
turing age calculator
What is the problem you are having?
how to make a turing age calculator?
Describe what you have tried to solve this problem
the user has to enter year of birth,month and date
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
thanks!
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dreadnought
|
Posted: Fri Mar 02, 2012 9:02 pm Post subject: Re: turing age calculator |
|
|
The code you posted doesn't compile, I suggest you have a close look at it, you are missing a few expressions for a working program.
Jokes aside, please show us what you've tried, we wont do your homework for you but we'll be happy to help you with an difficulties you encounter.
Criticism aside, try to think about how you would approach the problem given this information and a pencil and paper (mathematically). Then try to translate this into Turing.
Example: I tell you I was born on May 17 1932, how old am I? How did you figure it out? What basic steps (math) were involved? |
|
|
|
|
|
QuantumPhysics
|
Posted: Sat Mar 03, 2012 12:22 pm Post subject: RE:turing age calculator |
|
|
var age, year : int % your variables
put "Please enter your year of birth: " .. % prompts the user for the task
get year % gets the year of birth and stores it in this variable
age := 2012 - year % assuming they already aged this year
% otherwise you can just edit the code to make it so it displays exact age
put "You are now ", age, " years old!";
There, i hope thats what you were looking for. |
|
|
|
|
|
|
|