In: Computer Science
An employee’s total weekly pay equals the hourly wage multiplied by the total number of regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wage. Write a python program that takes as input the hourly wage, total regular hours, and total overtime hours and displays an employee’s total weekly pay.
The script must start with comments about the author, assignment and submission date. Save the script using the following naming convention: Name_SID_Assignment#.py. Please submit pseudocode, flow chart and screenshot of the output.
Answer: Hey! Kindly find your solution here. This program is working well, output screenshot attached. If you have any queries, feel free to ask me. Thanks
Python program
print("Enter the hourly wage") #print this text on screen
hourlywage = float(input()) #takes input for hourly wage
print("Enter regular hours:") #print this text on screen
regularHours = int(input()) #takes input for regular hours
print("Enter overtime hours: ") #print this on screen
overtimeHours = int(input()) #takes input overtime hours
weekPay = hourlywage * regularHours #calculate weekpay for regular hours
overtimePay = overtimeHours * 1.5 * hourlywage #calculate overtime pay
weekPay = weekPay + overtimePay #add overtime pay into weekpay
print("Total week pay: $" + str(weekPay)) #display week pay
Pseudocode-
Function Main
Declare Real hourlywage, weekPay, overtimePay
Declare Integer overtimeHours, regularHours
Output "Enter the hourly wage"
Input hourlywage
Output "Enter regular hours:"
Input regularHours
Output "Enter overtime hours: "
Input overtimeHours
Assign weekPay = hourlywage*regularHours
Assign overtimePay = overtimeHours*1.5*hourlywage
Assign weekPay = weekPay+overtimePay
Output "Total week pay: $"&weekPay
End