Skip to content

Update Exercise1.py#1

Open
alexssdean12 wants to merge 1 commit into
AdityaBagad:masterfrom
alexssdean12:patch-1
Open

Update Exercise1.py#1
alexssdean12 wants to merge 1 commit into
AdityaBagad:masterfrom
alexssdean12:patch-1

Conversation

@alexssdean12
Copy link
Copy Markdown

First change '10' from being hardcoded to the variable rate as this will allow for other rates to be inputed.

Next change is '40' needs to be hard coded as that is the base hours. Right now the formula would be (45 * 10) +75 when it should be (40 * 10) + 75.

First change '10' from being hardcoded to the variable rate as this will allow for other rates to be inputed. 

Next change is '40' needs to be hard coded as that is the base hours. Right now the formula would be (45 * 10) +75 when it should be (40 * 10) + 75.
Copy link
Copy Markdown

@Kashaf212 Kashaf212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of hours multiplied by rate, 40 will be multiplied because the rate of first 40 hours is the same. If extra work is done than hourly rate will increase 1.5 times. and it will be added to pay formula.
I am writing my solution here below:
hours = input("Enter hour:")
hourly_rate = input("Enter rate per hour:")

if int(hours)>40:
rate=1.5int(hourly_rate)(int(hours)-40)
pay = float(hourly_rate) * 40
pay=pay+rate
print(pay)
else:
pay=int(hours)*int(hourly_rate)
print(pay)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants