Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Itziar Denise Villafuerte Martinez

IT 140 Introduction Scripting


Pseudo Code Assignment

Problem: A company wants a program that will calculate the weekly paycheck
for an employee based on how many hours they worked. For this company,
an employee earns $20 an hour for the first 40 hours that they work. The
employee earns overtime, $30 an hour, for each hour they work above 40
hours.

Example: If an employee works 60 hours in a week, they would earn $20/hr


for the first 40 hours. Then they would earn $30/hr for the 20 hours they
worked overtime. Therefore, they earned: ($20/hr * 40hrs) + ($30/hr * 20 hrs)
= $800 + $600 = $1400 total.

For this assignment, you must create a pseudocode and a flowchart to design
a program that will calculate an employee’s weekly paycheck.

CODE:

Employees weekly hours: input()


# Establish hourly wage <= 40 = $20
#hourly_wage > 40 = $30
Hourly_wage = $20
Hours_over = $30
Input employees (hours_worked)
Hours_worked = int(input(‘How many hours did the employee work:’))
# calculate weekly_salary based on hours_worked
If hours_worked <= 40:
weekly_salary = hours_worked * hourly wage
Print(“weekly_salary <= 40”)
Else:
If hours_worked > 40:
Then (40 * 20) + ( hours_over * 30) = weekly_salary
40 hours x 20 dollars per hour added to hours_over(int) x 30 dollars an hour
print(“employees weekly_salary”)

Flowchart:

You might also like