00:01
In this video, we're going to be calculating the gross pay.
00:04
So to get started, we need to prompt the user for the hours as well as the rate.
00:10
So we're going to create an hour variable and the rate variable.
00:17
So for hours, we'll get the input.
00:20
So enter hours.
00:24
Hours worked.
00:29
So initially, this is going to be a string.
00:33
So we don't really want a string because we're not able to work with strings when we're trying to add.
00:40
So we want to convert this to a float, which we wrap using the float function.
00:49
And for the rate, we'll also do the same thing.
00:58
Interrate.
01:02
Okay, so now we're going to create an if statement, saying that if the user works to 40 hours.
01:17
So if hours is less than or equal to 40, we want to calculate the pay.
01:31
So it is a pay, we'll create a pay variable and the hour times.
01:43
Then we will print dollars and then our pay want to create an else if statement for if the hour is greater than 40.
02:06
The hours are created than 40.
02:08
We want to multiply the pay hour times 1 .5 times the rate.
02:19
We'll also print out the same amount.
02:28
Right, there we go.
02:30
So that is right.
02:33
Should be able to run it.
02:38
Okay, so let's run this...