From 438b3659db99915a6bd715fafa2884737705a9de Mon Sep 17 00:00:00 2001 From: Jonathan Vi Date: Mon, 7 Feb 2022 11:43:53 -0800 Subject: [PATCH] fixed ;, variable name, cout statements, and if loop bracket --- main.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index bb63cb8..537461b 100644 --- a/main.cpp +++ b/main.cpp @@ -5,23 +5,28 @@ int main() { int age; string name; - char last initial; + //cannot have space in variable name + char last_initial; +//missing ; at the end of cout + cout<<"Hi. What is your first name? "; - 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, "<>age>>endl; + cin>>last_initial; + //Missing "" between name, last initial and endl + cout<<"Thanks, "<>age; if( age < 12 ) { cout<<"Hey kid, how do you like school?\n"; } - if( age < 18 ) - cout<<"Cool!"endl; + //missing brackets for if statement + if( age < 18 ){ + cout<<"Cool!"<= 18 ); { cout<<"Pleased to meet you!\n";