binary '+': no global operator found...

Hello I am new to C++ and I need help with a homework assignment. We were told to write functions based on a code for the main function.
This is how the output is meant to look

Welcome to My Frozen Yogurt!
What size would you like? Please enter small, medium, or large: Large
Enter flavor 1: chocolate
Enter flavor 2: vanilla
Enter flavor 3: coconut

*************************************************
Order 1: choc-vani-coco large
*************************************************

Would you like another order? Please enter yes or no: Y
Would you like another order? Please enter yes or no: YES
What size would you like? Please enter small, medium, or large: M
What size would you like? Please enter small, medium, or large: MEDIUM
Enter flavor 1: mango
Enter flavor 2: strawberry
Enter flavor 3: chocolate

**************************************************
Order 2: mang-stra-choc medium
*************************************************

Would you like another order? Please enter yes or no: yes
What size would you like? Please enter small, medium, or large: small
Enter flavor 1: coconut
Enter flavor 2: lemon
Enter flavor 3: chocolate

**************************************************
Order 3: coco-lemo-choc small
*************************************************

Would you like another order? Please enter yes or no: no

=================== Receipt ====================

Number of items = 3
Subtotal: $10.17
Tax: $0.89
Total: $11.06

================================================

this is what I have so far


#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

void printWelcomeMessage(){
cout << "Welcome to My Frozen Yogurt!\n";
}
string getYogurtSize(string yogurtSize){
cout << "What size would you like? Please enter small, medium, or large: ";
getline (cin, yogurtSize);
return 0;
}
void getYogurtSize (double yogurtSize){
if (yogurtSize == small){
double subtotal = subtotal + 2.19;
} else if (yogurtSize == medium)
double subtotal = subtotal + 3.49;
if (yogurtSize == large){
double subtotal = subtotal + 4.49;
}
return getYogurtSize;
}
void toUpper(string yogurtSize){
if (yogurtSize == "SMALL" && yogurtSize == "MEDIUM" && yogurtSize == "LARGE"){
cout << yogurtSize;
}else if (yogurtSize == "small"|| yogurtSize == "medium" || yogurtSize == "large"){
cout << yogurtSize;
}

}
int getYogurtFlavors(string flavor1, string flavor2, string flavor3){
cout << "Enter flavor 1: ";
getline (cin, flavor1);
cout << "Enter flavor 2: ";
getline (cin, flavor2);
cout << "Enter flavor 3: ";
getline (cin, flavor3);
cout << endl;
return 0;

}
string printOrder(string yogurtSize, string flavor1, string flavor2, string flavor3, int orderNumber){
cout << "***********************************\n";
cout << "Order " << orderNumber ;

cout << ": " << flavor1. substr (0,4) << "-" << flavor2.substr(0,4)
<< "-" << flavor3.substr(0,4) << setw(12) << yogurtSize << endl;
cout << "***********************************\n" << endl;
return 0;
}
bool more_order(string addAnotherOrderQ) {
cout << "Would you like another order? Please enter yes or no: ";
getline(cin, more_order);
if ( more_order == "yes" ){
return true;
}else if (more_order == "no"){
return false;
}
}
string printTotalCosts(double subtotal, int orderNumber){
cout << "================= Receipt ==================\n";
cout << endl;
cout << "Number of items = " << orderNumber << endl;
cout << "Subtotal: " << setw(6) << "$" << subtotal << endl;
double tax= subtotal * .0875;
cout << "Tax (8.75%):" << fixed << setprecision(2) << setw(4) << "$"<< tax << endl;
double total = subtotal + (1 + tax);
cout << "Total:"<< fixed << setprecision(2) << setw(10) << "$" << total << endl << endl;
cout << "============================================\n"<<endl;
return 0;
}


int main (){

// Print the welcome message
printWelcomeMessage();

// initialize the loop variables
bool more_order = true;
int orderNumber = 0;

// Variable for cost
double subtotal = 0;

// Variable for size and flavors default initialized to ""
string yogurtSize, flavor1, flavor2, flavor3;

// Continue to get orders until the user is done
while (more_order) {

// Increment order number
orderNumber ++;

//Update the size and subtotal
subtotal = subtotal + getYogurtSize(yogurtSize);

// Update the flavors
getYogurtFlavors(flavor1, flavor2, flavor3);

// Print the current order
printOrder(yogurtSize, flavor1, flavor2, flavor3, orderNumber);

// Determine whether or not to order more
more_order = addAnotherOrderQ();
}

// Print out the subtotal, tax, and total
printTotalCosts(subtotal, orderNumber);

return 0;
}


however it says
binary '+': no global operator found which takes type 'std::string' (or there is no acceptable conversion) and
'addAnotherOrderQ': function does not take 0 arguments

If someone can please help me, that would be greatly appreciated.


hiya,
i've only had a quick look but here looks strange:

more_order = addAnotherOrderQ();

You've defined more_order to be a funtion that takes a string a returns a bool, which is not how you're using it in the line above. I'd expect to see something like this:

1
2
3
4
string orderString = "no";
bool moreOrdersRequired = false;
moreOrdersRequired = more_order(orderString );


addtionally the other strange this is you don't seem to actually use the string in the function.
Regarding calling and using functions, have a read of this:
http://www.cplusplus.com/doc/tutorial/functions/



It would be nice if you used [code][/code] tags and referred to line numbers so we could find the errors.

I think mutexe has the function error answered nicely, so I'll mention what I saw about the operator+() error:

On one of the lower lines (no line numbers, sorry), you are trying to use + on a string and a double; that isn't a defined operation.
Thanks I`m afraid I still do not quite understand how to fix these problems. As I said I am new to this so bare with me.
Topic archived. No new replies allowed.