From 7001309f87dead4460268af3ae163260c0e953c9 Mon Sep 17 00:00:00 2001 From: Meher Lippmann Date: Mon, 7 Feb 2022 11:43:36 -0800 Subject: [PATCH] fixed bugs: incorrect operators for 'cin' --- main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.cpp b/main.cpp index bb63cb8..671328a 100644 --- a/main.cpp +++ b/main.cpp @@ -5,23 +5,25 @@ int main() { int age; string name; - char last initial; + char last_initial; - cout<<"Hi. What is your first name? " - cin<>last initial; - cout<<"Thanks, "<> name; + cout << "name, what is the first letter of your last name? " << std::endl; + cin >> last_initial; + cout<< "Thanks, " << name << " " << last_initial <<"."<< std::endl; cout<<"Please also tell me how old you are: "; - cin>>age>>endl; + cin>>age; if( age < 12 ) { cout<<"Hey kid, how do you like school?\n"; } if( age < 18 ) - cout<<"Cool!"endl; + { + cout<<"Cool!" << endl; cout<<"How's highschool going?\n"; + } else( age >= 18 ); { cout<<"Pleased to meet you!\n";