Jump to content
  • Advertisement
Sign in to follow this  
derekpainter1

thanks very much guys, girls works now

This topic is 4494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

any help would be greatly appreciated if anyone can help me with the compile errors in this code. please. Next time ill post the errors it works now thanks.

// pg 107 exercise 2

#include <iostream>
#include <cmath>

using namespace std;

float FeetToInches(int,int);
float PoundsToKilos(int);
float ConvertBmi(float,float);

int main();
{

int feet;
int inches;
int pounds;
 
cout << " Please enter your height in feet." << endl;
cin >> feet;
cout << " Please enter your height in inches." << endl;
cin >> inches;
cout << " Please enter your weight in pounds."<< endl;
cin >> pounds; 

float inMeters = FeetToInches(inches,feet);
float inKilos = PoundsToKilos(pounds);
float bmi = ConvertBmi(inKilos,inMeters);

return 0;
}


float FeetToInches(int inch,int ft)
{
  const int toInches = 12;
  int totalInches = inch + (ft* toInches); //convert to total inches
  const float toMeters = 0.0254;             //convert totalinch to kilo
  float Meters = totalInches * toMeters;
  return Meters;
 } 
  
  float PoundsToKilos(int lbs)
  {
  const float ToKilos = 2.2;           // pounds to kilos
  float converted = lbs / 2.2 ;
  return converted;
  }
  
  float ConvertBmi(float kilo,float mtrs) // calculate bmi
  {
    float bmi = kilo / sqrt(mtrs);
    return bmi;
 }
    


[Edited by - derekpainter1 on July 3, 2006 4:50:49 PM]

Share this post


Link to post
Share on other sites
Advertisement
int main();
{

(the semicolon shouldn't be there)

Also, you have a few conversion warnings that you may want to address. Next time, please post the errors you are getting.


jfl.

Share this post


Link to post
Share on other sites
also FeetToInches actually converts to meters (no logic error, just bad name)

Share this post


Link to post
Share on other sites
"thanks very much guys, girls works now"

What an interesting description of a problem.

When someone helps you, you make another post to notify him that the problem is fixed and thank him. You don't edit your original post and change the title of the thread,thus making it useless for everyone else. Geez.

Share this post


Link to post
Share on other sites
Quote:
Original post by mikeman
"thanks very much guys, girls works now"

What an interesting description of a problem.

When someone helps you, you make another post to notify him that the problem is fixed and thank him. You don't edit your original post and change the title of the thread,thus making it useless for everyone else. Geez.


Only in the U.S [grin]

Share this post


Link to post
Share on other sites
At first I thought this was another girl thread but then I was like, "Why isn't it in the lounge???". Lol. It's just that I interpreted that "girls" work now, and before the help they didn't.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!