Looks like a great board I will be honest here. I am 31 years old and I have recently decided to take some classes, to see what may spark some interest. Well right now I need some help!
I would like to see if any one can help me figure out this mess I have made.
Now what I am aiming for is displaying the total amount of calories for entrees that the user will input (for all 21 meals). But somewhere I have missed a few things.
using namespace std;
friend ostream& operator<<(ostream& out, const Meal &aMeal);
friend istream& operator<<(istream& in, Meal &aMeal);
Meal(char ent); //constructor
int operator + (Meal &meals); //overload operator +
calorie = calorie;
int Meal::operator + (Meal &meals)
cals = calorie + meals.calorie;
ostream& operator<<(ostream& out, const Meal &aMeal)
out<<"The total calories for all of the meals is: "<<endl;
istream& operator<<(istream& in, Meal &aMeal)
cout<<"Enter the entree: ";
cout<<"Enter the amount of calories: ";
for(int i = 0; i < 21; i++)
An overload extraction operator is needed to prompt the user for an entree' name and calorie count for a meal.
Also need the statement total = breakfast + lunch + dinner; in the program... but is it possible to get this code to run without that statement?
Thanks in advance for any replys.