Q:

Issue with unexpected unqualified id error

I just started with C++, using xcode. I'm attempting to write a simple, if user works x amount user gets payed y amount, program. I'm not sure if what I have is right, but I can't test it because I'm getting an error "Expected unqualified-id" on the line with the first {. It is the only error listed and I can't figure out how to fix it. 
#include <iostream>

using namespace std;

int main ()

int user;
int salary1 = user * 12;
int salary2 = (user * 18) + 480;
{ // this is the line I'm receiving error.
    cout << "Enter the number of hours you worked this week";
    cin >> user;

    if (user <= 40)
    {
        cout << "You made" << salary1 << "this week!"
    }
    else (user > 40)
    {
        cout << "You made" << salary2 << "this week!!!"
    }
return 0;
}

A:

Declare the variables inside the int main block and calculate salary after receiving user input.
#include <iostream>

using namespace std;

int main ()   
{ 
    int user;
    cout << "Enter the number of hours you worked this week";
    cin >> user;
    int salary1 = user * 12;
    int salary2 = (user * 18) + 480;
    if (user <= 40)
    {
        cout << "You made" << salary1 << "this week!"
    }
    else (user > 40)
    {
        cout << "You made" << salary2 << "this week!!!"
    }
    return 0;
}

