Using functions in a program

I have to write a program that requires the use of four functions, one for input, two for the calculation and one for the output of the calculated values.

The program is supposed to take as input a measurement in kilograms an grams and then convert the measurements to pounds and ounces.

The first function is intended to ask the user for their measurement in kilos and grams which is to be calculated using two value-return functions, one returning pounds and the other returning ounces. The third function is to be used to output the results.

I am then supposed to have the main operate a loop which allows continuous conversions until they decide to quit the program.

I have absolutely no idea how to go about writing this. I'm fairly certain that I am to declare the functions before the main function and then go about as usual with my cin and cout syntax.

I would greatly appreciate it if someone could help me figure out how to get this program started. I'm new to functions and I find them confusing.
Thanks in advance!!!
Functions have the following logic:
A function takes some data, does some calculations on it, and returns some data to the place it was called from.

Here is how you define a function:
ReturnType FunctionName(DataType)
{
}

For example,
int Calculate(int data)
{
return data + 5;
}

If you were to use the function like this:
int a = Calculate(6);
a would equal 11. You could now use this value for whatever you need it for.

Look up "c++ functions" on the internet to get a better tutorial.

Hope this helps!
theturk1234
http://www.cplusplus.com/forum/general/199168/

Please stick to this post only
Topic archived. No new replies allowed.