#include <stdio.h>

int main(void) {

	int hoursWorked;
	double hourlyRate;
	double salary;
	printf("%s", "Enter # of hours worked (-1 to end): ");
	scanf("%d",&hoursWorked);
	
	while (hoursWorked != -1)
	{
		printf("%s", "Enter hourly rate of the worker ($00.00): ");
		scanf("%lf",&hourlyRate);
		if (hoursWorked <= 40)
		{
			salary = hoursWorked * hourlyRate;
		}
		else
		{
			salary = 40 * hourlyRate + (hoursWorked - 40) * hourlyRate * 1.5;
		}
		printf("Salary is: $%.2f\n", salary);
		puts("");
		printf("%s", "Enter # of hours worked (-1 to end): ");
		scanf("%d", &hoursWorked);
	}
}
