Computer Science Canada

Turing Help

Author:  KrazyBatMan [ Thu Apr 15, 2004 10:35 am ]
Post subject:  Turing Help

Hello, i'm in need of some help. I have 2 questions in school that i dunno how to do using Turing. I was wondering if i could get some help or just the answers. Well here are the questions. Embarassed

Write and test a subprogram that will take an array of names and remove all duplicates. Read the list of names from a file. The first line of the file contains the number of names in the file. Submit the procedure and the test program in one file.

Write a recursive function called power that when called as power (x, n) will produce the value xn, where x is a real number and n is an integer. Use the recurrence relation xn = xn - 1 * x and x0 = 1. Test your function by writing a main program that asks the user for the base and the exponent. Make sure you bullet-proof your program. Submit the function and the test program in one file.

Thank you for any help.

Author:  Tony [ Thu Apr 15, 2004 4:05 pm ]
Post subject: 

first of all - use meaningful subject headings. We already know it has to do with turing help since that's the forum you posted in.

Otherwise - removing dublicated from an array

as for the recursive function... Umm... the result will always be 1 for the function you described Laughing
code:

function power(x,n:int):int
result x**n
end power

put power(2,3)


: