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

Username:   Password: 
 RegisterRegister   
 Function and Procedure: Without Exponential Operator?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
PrinceCooper




PostPosted: Mon Jun 13, 2011 9:52 am   Post subject: Function and Procedure: Without Exponential Operator?

Problem:
The program needs to use a function named Power that raises its first parameter (a real value) to the power indicated by the second parameter (an integer), without using the exponential operator (**). The function will return the result.

Issue:
I can achieve this WITH the use of the exponential operator, but completely confused without it.
I would appreciate it if someone could help me with this problem and explain how they came to their conclusion so I can avoid this issue in the future if at all possible.

Bonus:
Change the function into a procedure that returns the result of power operation into a third parameter.




4.0.4c[/b]
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jun 13, 2011 10:00 am   Post subject: RE:Function and Procedure: Without Exponential Operator?

The idea is to implement the exponential operator as a Power function, so you should start with the definition -- how is the ** operator defined (what exactly does it do)?
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: