From 4aa817575fd2f0e47c7284a6738f1215a5055e7d Mon Sep 17 00:00:00 2001 From: Jeremiah Moran <79604680+jmmoran-us@users.noreply.github.com> Date: Mon, 7 Feb 2022 11:35:45 -0800 Subject: [PATCH 1/3] Fix errors Fixed errors such as not displaying the person's name when asking for the last name initial, If the person is under 12 years old they would get how is high school going AND hey kid do you like school, missing some quotation makes just before asking age. --- main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index bb63cb8..192ca96 100644 --- a/main.cpp +++ b/main.cpp @@ -9,9 +9,9 @@ int main() cout<<"Hi. What is your first name? " cin<>last initial; - cout<<"Thanks, "<>age>>endl; @@ -19,7 +19,7 @@ int main() { cout<<"Hey kid, how do you like school?\n"; } - if( age < 18 ) + else if( age < 18 ) cout<<"Cool!"endl; cout<<"How's highschool going?\n"; else( age >= 18 ); From 133b511e5ff767f046deb51523d9ec9bb90bf983 Mon Sep 17 00:00:00 2001 From: Jeremiah Moran <79604680+jmmoran-us@users.noreply.github.com> Date: Mon, 7 Feb 2022 11:46:53 -0800 Subject: [PATCH 2/3] Fix errors (again) The previous push still had bugs. --- main.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index 192ca96..0fb223a 100644 --- a/main.cpp +++ b/main.cpp @@ -5,24 +5,26 @@ int main() { int age; string name; - char last initial; + char last_initial; - cout<<"Hi. What is your first name? " - cin<>name; cout<>last initial; - cout<<"Thanks, "<>last_initial; + cout<<"Thanks, "<< name << " " << last_initial<<"." << 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"; } - else if( age < 18 ) - cout<<"Cool!"endl; + else if( age < 18 ) + { + cout<<"Cool!" << endl; cout<<"How's highschool going?\n"; - else( age >= 18 ); + } + else { cout<<"Pleased to meet you!\n"; } From 58d91e3b08751668477f61e2e4620530febf1672 Mon Sep 17 00:00:00 2001 From: Jeremiah Moran <79604680+jmmoran-us@users.noreply.github.com> Date: Mon, 7 Feb 2022 13:14:38 -0800 Subject: [PATCH 3/3] initial 123 --- main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/main.cpp b/main.cpp index 0fb223a..11f143b 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,7 @@ #include using namespace std; +//comment int main() { int age;