Okay here is a program that i have to write but i cant seem to get to run with what i have.
/*****************************************************
Write a program that asks the user if he or she wants to convert values that are lengths or weights. If the user chooses lengths, the program calls a stub function convert_lengths that simply indicates the user’s choice. If the user chooses weights, the program calls a stub function convert_weights that simply indicates the user’s choice. Use the value 1 to indicate lengths and the value 2 to indicate weights. If the user enters 0, terminate the program. The program should continue to prompt the user for input until he or she correctly enters a value of 0, 1, or 2. In addition, the program should allow the user to call convert_lengths or convert_weights as many times as desired (i.e., until a value of 0 is input, indicating that the user is finished).
********************************************************/
void introduction()
{
cout << "this program will convert lengths and weights" << endl;
}
void get_intput(double value)
{
cout << "would you like to convert? 1, 2 or 0." << endl;
cin >> value;
Here is your code reposted with code tages. Please use code tags in the future.
If you don't know what they are, its the button that looks like this <> to the right of your screen when you are posting.
You need a function main to start with. Create a function main, and then call your functions from main. You will need to use a loop, that exits when 0 is pressed. Your tag functions convert_lengths should output lenght, and convert_weights should output weights. The fucniton output isn't really needed here. Also in your introduction function you need to tell the user what they are expected to input. It just say's press 1,2, or 0.
I understand but thank you for your help Yanson! Where i am struggling is how to properly call the functions from main...as far as ending the loop i shouldnt have a problem with that. Though, how would the code look for main?