Computer Science Canada Turing Tutorial Guide Fourth Edition Troubles! |
Author: | haloistaken [ Mon Oct 05, 2009 3:37 pm ] | ||
Post subject: | Turing Tutorial Guide Fourth Edition Troubles! | ||
What is it you are trying to achieve? I'm trying to finish Questions 11 & 12 found in Chapter 4 - Repetition in the book "Turing Tutorial Guide J.N.P Hume Fourth Edition" What is the problem you are having? Here are the questions of the chapter im having difficulty with: Q 11. A homeowner takes out a mortgage for $120,000 at 10.75% (interest) per year. At the end of each year an amount of $24,000 is paid. Write a program to show how the mortgage is paid off, year by year, until nothing is owing.\ Q 12. Write a program to simulate the playing of a simple dice game (played with one die). Roll the die to get a value from 1 to 6. This we will call your point. Now keep rolling until you get the same value (your point) again and see how many rolls it takes. Program it so you can play this game repeatedly. Describe what you have tried to solve this problem For Q11, i tried using many many formulas and sums but i kept messing up and never figured how to do it, so some help would be helpful lol. FOr Q12, its basically the same problem as Q.11 lol. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
At school i use i think 4.04 and at home i have 4.1.1 <Answer Here> |
Author: | Tony [ Mon Oct 05, 2009 3:50 pm ] | ||
Post subject: | RE:Turing Tutorial Guide Fourth Edition Troubles! | ||
While both problems could be solved by coming up with a formula, the intend of the questions is to have a loop go over every iteration.
|
Author: | haloistaken [ Mon Oct 05, 2009 4:13 pm ] | ||
Post subject: | Re: RE:Turing Tutorial Guide Fourth Edition Troubles! | ||
Tony @ Mon Oct 05, 2009 3:50 pm wrote: While both problems could be solved by coming up with a formula, the intend of the questions is to have a loop go over every iteration.
You cannot use "while" statements in turing :/. THe only possible "while" statement i can think of is by adding a loop and putting an exit when (still have to pay) =< 0 But even still i need someone to help me wrrite the full code. I was unable to copy my code from school and its due tomorrow >.>. I really need to KEEP A usb at school >.> lol. So if anyone could do me the favour of writing these progs out (not begging just asking) or giving me an explanation would be very helpful and idk if this forum has some sort of rep thingi because i do like to rep /thanks a lot :p Also Tony what is iteration? I heard that before... ![]() |
Author: | Tony [ Mon Oct 05, 2009 4:20 pm ] |
Post subject: | Re: RE:Turing Tutorial Guide Fourth Edition Troubles! |
haloistaken @ Mon Oct 05, 2009 4:13 pm wrote: So if anyone could do me the favour of writing these progs out
In forum rules, we explicitly specify that this is not to be done. You're supposed to do your assignments yourself. Quote: Also Tony what is iteration? I heard that before... ![]() Quote: iteration |ˌitəˈrā sh ən| noun the repetition of a process or utterance. ? repetition of a mathematical or computational procedure applied to the result of a previous application, typically as a means of obtaining successively closer approximations to the solution of a problem (That is, each step of a loop) |
Author: | haloistaken [ Mon Oct 05, 2009 4:28 pm ] |
Post subject: | Re: RE:Turing Tutorial Guide Fourth Edition Troubles! |
[quote="Tony @ Mon Oct 05, 2009 4:20 pm"] haloistaken @ Mon Oct 05, 2009 4:13 pm wrote: So if anyone could do me the favour of writing these progs out
In forum rules, we explicitly specify that this is not to be done. You're supposed to do your assignments yourself. Lol i figured you'd say something like that but by "writing the progs out " i meant like a raw structure like you did but a bit more detailed since i dont understand and if i post my code up (which i dont have on me) you will probably go crazy like my friend coz he says my code is waii too messy |
Author: | haloistaken [ Tue Oct 06, 2009 6:44 am ] |
Post subject: | RE:Turing Tutorial Guide Fourth Edition Troubles! |
Omg...no one was able to help me lol...and i have to hand in today >.< |