Question
Jan Villaroel
Topic: Computer Science Posted 1 year ago
A company wants a program that will calculate the weekly paycheck for an employee based on how many hours they worked.

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 pseudocode and a flowchart to design a program that will calculate an employee’s weekly paycheck.

Write pseudocode to design a programming solution by outlining a series of steps and using appropriate indentation and keywords. As you write your pseudocode, be sure to consider the following:

◦ What input does the computer need?
◦ What steps does the program need to follow to process the input? What output should result?
◦ When might you need to use decision branching? If you used decision branching, did you account for all possible input values?
◦ Did you use appropriate indentation and keywords (such as IF, ELSE, CALCULATE, and so on) throughout your pseudocode?


Answers
What are best answers and total votes?
No Votes
Vote
SignIn to Vote
Koala Tutor
Sep 28, 2023
Koala Ai Support

START
DECLARE rate = 20
DECLARE overtime = 30
DECLARE regular_hours = 40
DECLARE overtime_hours
DECLARE total
DECLARE hours_worked

DISPLAY "Enter the number of hours worked: "
GET hours_worked

IF hours_worked <= regular_hours THEN
CALCULATE total = rate * hours_worked
ELSE
CALCULATE total = (rate * regular_hours) + (overtime * (hours_worked - regular_hours))
ENDIF

DISPLAY "The total weekly paycheck is $" + total
END

Koala Tutor Got a question with my answer?
Message Me