Need help with this program. I am new tpo programing and am not expereience in c++. Theanks for you hel I understand there are lots of errors but don tknow how to fix them.
The Purpose of this code is to create a mad lib
Code:#include<iostream> #include<string> using namespace std; int main(void) { cout << "Enter in words each word with one space in between;" <<endl; cout << endl; string onesName; cout << "Enter your first name; "; cin >> onesName; cin.ignore(99,'\n'); string famousPerson; cout << "Enter the name of famous person; "; cin >> famousPerson; cin.ignore(99,'\n'); string animalInput; cout<< "Enter an animal; "; cin >> animalInput; cin.ignore(99,'\n'); string numberInput; cout << "Enter a number, one digit only; "; cin >> numberInput; cin.ignore(99,'\n'); string emotionInput; cout << "Enter an emotion; "; cin >> emotionInput; cin.ignore(99,'\n'); string adjectiveInput; cout << "Enter an adjective; "; cin >> adjectiveInput; cin.ignore(99,'\n'); // this is processing: string dear = "Dear, " + onesName + '!'; string seconline = "I wanted to inforn you the" + famousePerson + 'received your letter.'; string thirdline = "We just wanted to tell you that he does not have your" + animalInput + '!'; string fourthline = " But we will gladly donate" + numberInput + 'for your cause.'; string fifthline = "We are sorry and hope you have a" + emotionInput + 'day.'; string lastline = "Your" + adjectiveInput + 'friend, Jesus G.'; // this is output: cout << dear << endl; cout << secondline << endl; cout << thirdline << endl; cout << fourthline << endl; cout << fifthline << endl; cout << endl; cout << lastline << endl; cout << endl; // endgame cout << endl << "ENTER to finish..."; cin.ignore(99,'\n'); return 0; }



LinkBack URL
About LinkBacks



