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

Username:   Password: 
 RegisterRegister   
 Turing Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KrazyBatMan




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Apr 15, 2004 4:05 pm   Post subject: (No 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)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: