From acbc5a93a3ddd31f3c0ac80738dfc37a9c001935 Mon Sep 17 00:00:00 2001 From: kevdouglass Date: Mon, 7 Feb 2022 11:42:32 -0800 Subject: [PATCH] Fixed bugs in main. program runs --- main.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/main.cpp b/main.cpp index bb63cb8..2a4cf6c 100644 --- a/main.cpp +++ b/main.cpp @@ -1,31 +1,29 @@ #include using namespace std; -int main() -{ +int main(){ int age; string name; - char last initial; + char last_initial; - cout<<"Hi. What is your first name? " - cin<>name; cout<<"name, what is the first letter of your last name? "; - cin>>last initial; - cout<<"Thanks, "<>last_initial; + + cout<<"Thanks, "<>age>>endl; + cin>>age; - if( age < 12 ) - { + if( age < 12 ){ cout<<"Hey kid, how do you like school?\n"; } - if( age < 18 ) - cout<<"Cool!"endl; + if( age < 18 ){ + cout<<"Cool!" << endl; cout<<"How's highschool going?\n"; - else( age >= 18 ); - { - cout<<"Pleased to meet you!\n"; } + else if( age >= 18 ) + cout<<"Pleased to meet you!\n"; return 0; }