(Solved) : Write C Program Using C String Functions Read Output Concatenate Append Strings Writing 2 Q35599340
Write a C++ program, using C++only.
String functions: Read and Output, Concatenate(+) and/or append() strings
You will be writing 2 functions plus a main() function.Here are my function prototypes to get you going. But if you’drather write your own, that is OK as long as the match therequirements below.
void GetMeals (string& breakf, string& lun,string& din, string& snak);
string AllDayMeals (string breakf, string lun, string din, stringsnak);
- Write a function with pass-by-reference parameters, to read infavorite breakfast, lunch, dinner and snack foods (4 strings).These are input a line-at-a-time using getline(cin, …..)
- Write a function with pass-by-value parameters, and a returnstatement that will concatenate these 4 strings into a singlestring of this format (including the newlines):
My favorite breakfast is bacon and eggs,
my favorite lunch is cheeseburger with fries,
my favorite dinner is meat pinwheels,
and I love to snack on peanuts or almonds!
Write a main() that tests your functions.
- Call the first to get your meal favs. YOUR CHOICE of meal items(as in, they don’t have to match the above).
- Then call the 2nd function. After that, simply cout<< the returned string.