Expanding on Want Cake with Strings
So here is what I wanted for the “Want Cake” program I made. I really wanted it to output text as well, so I started working with strings to achieve this. Now the program asks, “What drink do you want?”
#include <iostream>
#include <string>
using namespace std;
int main() {
string cake;
cout << "How many pieces of cake do you want? ";
getline(cin, cake);
cout << "You now have " << cake << " Pieces of Cake.\n";
cout << "What drink do you want? ";
getline(cin, cake);
cout << "You now have a " << cake << " as well.\n";
return 0;
}