I have this homework, and yes, I've read the homework forum post about not having people here do it for me. I'm 100% okay with that because I'm a Computer Science major and just need to ask a few questions (I'm taking my Intro to Computer Programming Concepts online [seems to be a mistake])

Code:
#include<stdlib.h>
#include<stdio.h>
int main () {
    //Declare Variables
    double hours, hourlyRate, grossPay, overTime, overPay; 

    //Enter hours & hours worked
    printf("Enter the amount of hours you worked here: ");
    scanf("%lf", &hours); 
    printf("Your total hours worked %.2lf\n", hours);
    printf("Enter your hourly rate here: ");
    scanf("%lf", &hourlyRate);
    printf("Your hourly rate is %.2lf\n", hourlyRate);

    //Calculations
    if (hours > 40) {
        overTime = (hours - 40);
        overPay = (hourlyRate * 1.5 * (overTime));
        grossPay = (40 * hourlyRate) + overPay;
    } else {
        grossPay = hours * hourlyRate;
    }
    
    
    //Print out
    printf("Your gross pay is: %.2lf\n", grossPay);
system("pause");
return 0;

}
In this code I wrote, no matter if I put 30 hours, or 45 hours, I get overtime for everything.
So, I took it in a different direction, and wrote this!

Code:
#include<stdio.h>
#include<stdlib.h>
int main () {
    //Declare Variables
    double hours, hourlyRate, grossPay, overTime, overPay; 

    //Enter hours & hours worked
    printf("Enter the amount of hours you worked here: \n");
    scanf("%lf", &hours); 
    printf("You have worked %.2lf\n", hours);
    printf("Enter your hourly rate here: \n");
    scanf("%lf", &hourlyRate);
    printf("Your hourly rate is %.2lf\n", hourlyRate);

    //Calculate gross pay
    if (hours <= 40);
        grossPay = hours * hourlyRate;
    if (hours > 40); 
        grossPay = (hourlyRate * 1.5) * hours;
    
    //Output gross pay
    printf("Your gross pay is: %.2lf\n", grossPay);

    system("pause");
return 0;
}
But within this code I don't get any over time no matter if it's 45 or 30 hours. -__-

If you want to know what it's supposed to do, then it's supposed to show the pay of a particular employee if he/she makes x amount of dollars during a period of time, where overtime happens after 40 hours and anything below 40 hours is just normal pay.

In his exact words:
"Develop an algorithm that will determine the gross pay of a particular employee. You need to read the hourly rate, and the amount of hours worked by the employee. You should display the hours, hourly rate, and gross pay of the employee. If the hours worked exceed 40 compute the overtime will be paid 1.5 *hourly rate. This program needs to have a selection statement that determines if the hours are overtime or not.

Test your program by entering an amount of hours that are over 40 and under 40."

I really appreciate any and all help anybody can give me. Thanks way ahead of time.