In: Computer Science
Write a program that calculates the salary of employees. The program should prompt the user to enter hourly rate and number of hours of work a day. Then, the program should display the salary daily, bi-weekly (5 days a week), and monthly.
Sample program:
Enter your hourly rate: >>> 20 Enter how many hours you work a day: >>> 8 Your daily salary is: $160 Your bi-weekly salary is: $1600 Your monthly: $3200
# do comment if any problem arises
# code
# read hourly rate of employee
hourly_rate= int(input("Enter your hourly rate:\n>>> "))
#read how many hours employee word a day
hours_per_day=int(input("Enter how many hours you work a day:\n>>> "))
#calculate daily salary
daily_salary = hourly_rate * hours_per_day
print(f"Your daily sallary is: ${daily_salary}")
#calculate bi-weekly salary
bi_weekly_salary = daily_salary * 10
print(f"Your bi-weekly salary is: ${bi_weekly_salary}")
#calculate monthly salary
monthly_salary = bi_weekly_salary * 2
print(f"Your monthly: ${monthly_salary}")
Screenshot of code:
Output: