
Max C. answered 11/28/22
Bachelors in Computer Science, 5+ Years of Experience
What input does the computer need?
In this case, only `hours` would be needed as input, since we know that the standard rate for everyone is $20 and $30 for overtime pay
What steps does the program need to follow to process the input? What output should result?
The program follows two main steps:
- See if hours > 40 or less than 40
- Calculate pay accordingly.
- If its greater than 40, then we know we need to account for over time so it would look something like this: total pay = (40 x $20) + (hours - 40 x $30).
- If its less than 40, then its simply going to be: total pay = (hours x $20)
When might you need to use decision branching? If you used decision branching, did you account for all possible input values?
Yes, we will use decision branching. Whether hours greater than or less than 40 hours, this is our decision and the branches will be: Include overtime and exclude overtime
Did you use appropriate indentation and keywords (such as IF, ELSE, CALCULATE, and so on) throughout your pseudocode?
The pseudocode will look something like this: