Wiihacks - Nintendo Wii Hacks Community
Left Container Right Container
 



Go Back   Wiihacks - Nintendo Wii Hacks Community > Wii Discussion > Lounge


Reply
 
LinkBack Thread Tools Display Modes
Old 10-16-2009, 10:51 AM   #1 (permalink)
Junior Member
Last Achievements
 
roastbeef's Avatar
 
Join Date: Sep 2009
Location: Puerto Rico
Posts: 59
Downloads: 1
Uploads: 0
Thanks: 10
Thanked 7 Times in 6 Posts
Points: 768, Level: 7
Points: 768, Level: 7 Points: 768, Level: 7 Points: 768, Level: 7
Activity: 0.5%
Activity: 0.5% Activity: 0.5% Activity: 0.5%
Send a message via MSN to roastbeef Wii Friend Code: None Yet
Those who know C++, I require assistance!

Okay you C++ users! This requires some basic C++ knowledge.

Now, I'm making a problem for my Computer Programming class that, in a part, I need to write a function.

The function should be, in c++:

basal_metabolic_rate<double> = 70 * (weight/2.2)...

This is the part I'm making a mistake, and it's the power function. I know the power function is, for example, pow(x,y) for x to the power of y. But I'm having problems on raising that small part of "(weight/2.2)".. I should raise that to the power of 0.756

So if anyone knows how to write that small part of the function in C++, please tell me. This stupid lab is due tonight and I keep doing this small mistake.
__________________
"So it goes."-Kurt Vonnegut
roastbeef is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-16-2009, 12:54 PM   #2 (permalink)
~WiiHacks Staff~
~*Jr. Moderator *~"

*We are always busy..
*ONLY Forum Donators...
can PM Staff at this time
if u pm me for help...
you better be a Forum donator or else!!
Last Achievements
 
davepm's Avatar
 
Join Date: Aug 2009
Location: Lincoln, UK
Posts: 1,688
Downloads: 5
Uploads: 0
Thanks: 37
Thanked 552 Times in 330 Posts
Points: 8,644, Level: 27
Points: 8,644, Level: 27 Points: 8,644, Level: 27 Points: 8,644, Level: 27
Activity: 99.8%
Activity: 99.8% Activity: 99.8% Activity: 99.8%
Wii Friend Code: None Yet
basal_metabolic_rate<double> = 70 * (pow((weight/2.2),0.756))

would that work?

dont forget to #define <math.h> if your doing this.

you could also define a second variable to store (weight/2.2)

temp_var = (weight/2.2)

power = pow(temp_var,0.756)

basal_metabolic_rate<double> = 70 * power


messy, but might work
davepm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to davepm For This Useful Post:
roastbeef (10-20-2009)
Old 10-16-2009, 01:30 PM   #3 (permalink)
~WiiHacks Staff~
~*Senior Moderator~"

*We are always busy..
*ONLY Forum Donators...
can PM Staff at this time
if u pm me for help...
you better be a Forum donator or a hot girl!!
Last Achievements
Award-Showcase
 
messie's Avatar
 
Join Date: Jun 2009
Posts: 3,827
Downloads: 8
Uploads: 0
Thanks: 34
Thanked 2,245 Times in 727 Posts
Points: 17,298, Level: 40
Points: 17,298, Level: 40 Points: 17,298, Level: 40 Points: 17,298, Level: 40
Activity: 99.9%
Activity: 99.9% Activity: 99.9% Activity: 99.9%
Wii Friend Code: None Yet
messie does work!!! lol
__________________
Simple rules:
a) Read the guides before posting -> GUIDES, FAQ, ERROR INDEX
b) Provide us with sufficient info when asking a question.
c) Some guy must have invented sentences, commas, fullstops. Let's honor him and use them...
d) We thank the people who have helped us by clicking the button.


"...βλέπεις τον άνθρωπο μικρό που τον πατάν στ'αλήθεια, τα πόδια του τα ίδια..."
messie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-16-2009, 01:37 PM   #4 (permalink)
~WiiHacks Staff~
~*Jr. Moderator *~"

*We are always busy..
*ONLY Forum Donators...
can PM Staff at this time
if u pm me for help...
you better be a Forum donator or else!!
Last Achievements
 
davepm's Avatar
 
Join Date: Aug 2009
Location: Lincoln, UK
Posts: 1,688
Downloads: 5
Uploads: 0
Thanks: 37
Thanked 552 Times in 330 Posts
Points: 8,644, Level: 27
Points: 8,644, Level: 27 Points: 8,644, Level: 27 Points: 8,644, Level: 27
Activity: 99.8%
Activity: 99.8% Activity: 99.8% Activity: 99.8%
Wii Friend Code: None Yet
Quote:
Originally Posted by messie View Post
messie does work!!! Lol
lies!!!!!!
davepm is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-20-2009, 03:44 AM   #5 (permalink)
Junior Member
Last Achievements
 
roastbeef's Avatar
 
Join Date: Sep 2009
Location: Puerto Rico
Posts: 59
Downloads: 1
Uploads: 0
Thanks: 10
Thanked 7 Times in 6 Posts
Points: 768, Level: 7
Points: 768, Level: 7 Points: 768, Level: 7 Points: 768, Level: 7
Activity: 0.5%
Activity: 0.5% Activity: 0.5% Activity: 0.5%
Send a message via MSN to roastbeef Wii Friend Code: None Yet
Thanks, but the problems were already submitted. But, I'll test it.
__________________
"So it goes."-Kurt Vonnegut
roastbeef is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 06:09 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2