Computer Science Canada I need help, fast! |
Author: | dymd3z [ Mon Apr 16, 2007 7:44 am ] |
Post subject: | I need help, fast! |
I'm new to turing and have no real clue as to what I am doing. I have a few problems to figure out on the program but no clue what to do. I'll list a few of them and if anyone can help I would REALLY appreciate it. They all deal with functions pretty much... 1. Write and test a function called circleArea that returns the area of a circle whose radius is given as a parameter. The formula for the area of a circle is pi radius squared. 2. Write and test a function called interest that returns the interest to the nearest cent on a bank balance after a specified numbers of years. The amount of the initial bank balance, the yearly interest rate as a decimal, and the number of years for which to calculate the interest are to be parameters of the function. 3. Write and test a procedure called swap for swapping the values between two string variables given as parameters of the procedure. Thats only a few of what I don't understand. I've no clue what I'm doing and no examples to look off of to give me a hint. Please, someone help me! |
Author: | SilverScope [ Mon Apr 16, 2007 8:22 am ] |
Post subject: | Re: I need help, fast! |
This might help : http://www.compsci.ca/v3/viewtopic.php?t=461 |
Author: | dymd3z [ Mon Apr 16, 2007 8:39 am ] |
Post subject: | RE:I need help, fast! |
Well I figured out 1 and 2 just now, but what you're saying is this site is useless other than looking/stealing peoples tutorials? |
Author: | Clayton [ Mon Apr 16, 2007 10:15 am ] |
Post subject: | RE:I need help, fast! |
No, but I'm saying that we don't just give out answers on a silver platter here. Chances are, if you just say "I don't get it, help me", you're just going to get a link to a tutorial or other post. What exactly are you having problems with? Perhaps we'll be able to help you more with more information. If you don't know what you need help with, I suggest taking a quick glance at the Turing Walkthrough. |
Author: | CodeMonkey2000 [ Mon Apr 16, 2007 7:18 pm ] |
Post subject: | RE:I need help, fast! |
Question number 3 is a redundant. You shouldn't use procedures to manipulate variables. It's bad practice. |
Author: | Clayton [ Mon Apr 16, 2007 7:21 pm ] |
Post subject: | RE:I need help, fast! |
and how do you propose to swap two variables then? This is a case where a procedure modifying variables is acceptable. |