c++ - Issue with unexpected unqualified id error -
I just started with C ++, using xcode. I am trying to write a simple, if the user pays the user in X round then the y amount, the program. I'm not sure what's right to me, but I can not test it because I first got the error with the "expected unqualified id" line for the first time. This is the only error listed and I do not know how to fix it.
#include & lt; Iostream & gt; using namespace std; Int main () int user; Int pay 1 = user * 12; Int salary2 = (user * 18) + 480; {// This line is getting me the error Cout & lt; & Lt; "Enter the number of hours that work this week"; Cin & gt; & Gt; the user; If (user & lt; = 40) {cout & lt; & Lt; "You made" & lt; & Lt; Pay 1 & lt; & Lt; "This week!" } And (User & gt; 40) {cout & lt; & Lt; "You made" & lt; & Lt; Pay 2 & lieutenant; & Lt; "This week!!!" } Return 0; }
Announce the variable within the main block and after receiving user input Calculate the salary.
#include & lt; Iostream & gt; using namespace std; Int main () {int user; Cout & lt; & Lt; "Enter the number of hours that work this week"; Cin & gt; & Gt; the user; Int pay 1 = user * 12; int salary2 = (user * 18) + 480; If (user & lt; = 40) {cout & lt; & Lt; "You made" & lt; & Lt; Pay 1 & lt; & Lt; "This week!" } And (user> 40) {cout & lt; & Lt; "You made" & lt; & Lt; Pay 2 & lieutenant; & Lt; "This week!!!" } Return 0; }
Comments
Post a Comment