I think I am only making this worse and worse... I need to write a program that uses functions and a for loop to calculate a hat size, (2.9*weight in pounds/height in inches), jacket size (height in inches*weight/288), and waist size (weight in pounds divided by 4.9)... I know this is full of errors, but what are the most glaring errors that I can fix before I do "touch-ups"??? Sorry, I am failing so miserably...

 # include <iostream>
 using namespace std;

 //prototypes
  void Get_Data (int&, int&, int&); // reads the weight, height in feet, and height in inches
  float Hat_Size (int, int, int); // returns the hat size to the main
  int Jacket_Size (int, int, int); // returns the jacket size to the main
  int Waist_Size (int, int); // returns the waist size to the main
  void Put_Data (float; int; int); // writes the sizes

  int main (void)
  {
      int weight, height_in_inches, height_in_feet;
      float Hat;
      int Jacket, Waist;

      //Read the Count for the Loop of 
      int loop_target;

      cout << "Enter the Amount of Times You Would Like to Loop this Program  :   ";
      cin >> loop_target;


      int count;
      for (count = 1; count <= loop_target; count=count++)


          {         

          void Get_Data (int weight, int height_in_inches, int height_in_feet)
               {
                cout << "Please Enter the Weight in Pounds:\n";
                cin >> weight;

                cout << "Please Enter the Height in Feet:\n";
                cin >> height_in_feet;

                cout << "Please Enter the Height in Inches:\n";
                cin >> height_in_inches;
               }

         float Hat_Size (int=2.9, int weight, int=4.9)
               {
               return Hat = (2.9)*(weight)/(4.9);
               }
         int Jacket_Size (int height_in_inches, int weight, int=288)
               {
               return Jacket = (height_in_inches)*(weight)/(288);
               } 
         int Waist_Size (int weight, int=4.9)
               {
               return Waist = (weight)/(4.9)
               }    
         void Put_Data (float; int; int) 
               {     
               cout << "Your Hat Size is:    "<< Hat << endl;
               cout << "Your Jacket Size is:   "<< Jacket <<endl;
               cout << "Your Waist Size is:   "<< Waist <<endl; 
               }
               return 0;
         }

         system ("pause");
  }

  void Get_Data (int&, int&, int&); // reads the weight, height in feet, and height in inches
  float Hat_Size (int, int, int); // returns the hat size to the main
  int Jacket_Size (int, int, int); // returns the jacket size to the main
  int Waist_Size (int, int); // returns the waist size to the main
  void Put_Data (float; int; int) // writes the sizes

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Please use code tags. Could you post the errors your are getting, and edit your first post using code tags. Then we can work through the errors. Once the program works, we can determine whether the logic is correct.

I fixed it up so it actually runs but I removed the whole height_in_feet variable because it was not being used.

Since there are so many errors I would suggest you relearn the basics of functions.

Check this against yours and see where you went wrong.

#include <iostream>
using namespace std;

//prototypes
void Get_Data( int&, int& ); // reads the weight, height in feet, and height in inches
float Hat_Size( int ); // returns the hat size to the main
int Jacket_Size( int, int ); // returns the jacket size to the main
int Waist_Size( int ); // returns the waist size to the main
void Put_Data( float, int, int ); // writes the sizes

int main()
{
	int weight, height_in_inches;
	float Hat;
	int Jacket, Waist;

	//Read the Count for the Loop of
	int loop_target;

	cout << "Enter the Amount of Times You Would Like to Loop this Program : ";
	cin >> loop_target;

	for( int count = 0; count < loop_target; count++ )
	{
		Get_Data( weight, height_in_inches );
		Hat = Hat_Size( weight );
		Jacket = Jacket_Size( height_in_inches, weight );
		Waist = Waist_Size( weight );
		Put_Data( Hat, Jacket, Waist );
	}
	//system("PAUSE");

	return 0;
}


void Get_Data( int &weight, int &height_in_inches )
{
	cout << "Please Enter the Weight in Pounds:\n";
	cin >> weight;

	cout << "Please Enter the Height in Inches:\n";
	cin >> height_in_inches;
}

float Hat_Size( int weight )
{
	return (2.9)*(weight)/(4.9);
}

int Jacket_Size( int height_in_inches, int weight )
{
	return (height_in_inches)*(weight)/(288);
}

int Waist_Size( int weight )
{
	return (weight)/(4.9);
}

void Put_Data( float Hat, int Jacket, int Waist )
{
	cout << "Your Hat Size is: "<< Hat << endl;
	cout << "Your Jacket Size is: "<< Jacket <<endl;
	cout << "Your Waist Size is: "<< Waist <<endl;
}
This article has been dead for over six months. Start a new discussion instead.