Void convert assistance

Hey, I was trying to write a program that converted inches to cms and pounds to kg but I don't really know what to put into the void convert at the end. This may be very simple of me but could anyone give me a hand? Help would be muchly appreciated.

#include<iostream>
using namespace std;

const int SENTINEL = -1 ; // used to end data entry
const double INCHES_TO_CMS = 2.54; // Converts inches to centimetres
const double POUNDS_TO_KG = 0.454; // Converts pounds to kilograms

void explain_program();
//tells user what the program does

void decimal_format(ostream& os);
// Displays decimal numbers in a "nice" format when displayed in os

void read_inches_pounds(int& height_in_inches, int& weight_in_pounds);
// Postcondition: height_in_inches and weight_in_pounds have values
// from user

void convert(int height_in_inches, int& weight_in_pounds,
double& height_in_cms, double& weight_in_kilos);
//Precondition: height_in_inches and weight_in_pounds are known positive values
//Postcondition: height_in_cms and weight_in_kilos have been calculated

void write_out(ostream& os, double height_in_cms, double weight_in_kilos);
//Precondition: height_in_cms and weight_in_kilos have values
//Postcondition: These values are written out in output stream os

int main()
{
int weight_in_pounds, // The users inputed weight in pounds
height_in_inches; // The users inputted height in inches
double weight_in_kilos, // The users weight in kilograms
height_in_cm; // The users height in centimetres

explain_program();
// Tells user what the program does

decimal_format(cout);
// decimals are formatted nicely on screen

// Get height_in_inches and weight_in_pounds, or SENTINEL, from the user
read_inches_pounds(height_in_inches,weight_in_pounds);

// Process values, unless SENTINEL is entered
while (height_in_inches != SENTINEL)
{
// Convert the height to centimeters and the weight to kilograms
convert(height_in_inches, weight_in_pounds,
height_in_cm, weight_in_kilos);

// Display the converted values to the user
write_out(cout,height_in_cm, weight_in_kilos);

// Get the next set of values for height_in_inches and weight_in_pounds, or SENTINEL
read_inches_pounds(height_in_inches,weight_in_pounds);
}
return 0;
}

void explain_program()
{
cout << "This program converts a height in inches to centimeters and a weight in pounds to kilograms.";
cout << "Enter " << SENTINEL << " to finish.";
}

void decimal_format(ostream& os)
{
os.setf(ios::fixed);
os.setf(ios::showpoint);
os.precision(2);
}

void read_inches_pounds(int& height_in_inches, int& weight_in_pounds)
{
// Get height in inches or SENTINEL from user
cout << "Please enter a height in inches: ";
cin >> height_in_inches;

if (height_in_inches != SENTINEL)
{
// Get weight in pounds from user
cout << "\nPlease enter a weight in pounds: ";
cin >> weight_in_pounds;
}
}

double convert(int height_in_inches, int& weight_in_pounds)
{
double height_in_cm, // Local variable used to get height in centimeters
weight_in_kilos; // Local variable used to get weight in kilograms

// Convert the height from inches to centimeters
height_in_cm = height_in_inches/INCHES_TO_CMS;

// Convert the weight from pounds to kilograms
weight_in_kilos = weight_in_pounds/POUNDS_TO_KG;

return height_in_cm, weight_in_kilos;
}

void convert(int height_in_inches, int& weight_in_pounds,
double& height_in_cms, double& weight_in_kilos)
{
double height_in_cm, // Local variable used to get height in centimeters
weight_in_kilos; // Local variable used to get weight in kilograms

//Calculate the height in centimetres
height_in_cm = height_in_inches* INCHES_TO_CMS;

//Calculate the weight in kilograms
weight_in_kilos = weight_in_pounds* POUNDS_TO_KG;

}


void write_out(ostream& os, double height_in_cm, double weight_in_kilos)
{
os << "\n\nThe height in centimeters is " << height_in_cm << endl;
os << "\nThe weight in kilograms is\n\n\n " << weight_in_kilos << endl;
}
Please edit your post and put the source inside code tags.
Topic archived. No new replies allowed.