172k views
4 votes
Write a program where the main part of the program collects the data such as employee hours, hourly rate, state of residence, and marital status.

It then calls the function Calculatewages() function and sends employee hours and hourly rate.


The Calculatewages () function would calculate the wages and sends it back to the main.

1 Answer

5 votes

Answer:

The program written in Python is as follows:

def Calculatewages(hours,rate):

wage = hours * rate

print("Wages: ",wage)

def main():

hours = int(input("Work Hours: "))

rate = float(input("Hourly Rate: "))

residence = input("State of Residence: ")

status = input("Marital Status: ")

Calculatewages(hours,rate)

main()

Step-by-step explanation:

This line defines the Calculatewage() function along with two parameters; hours and rate

def Calculatewages(hours,rate):

This line calculates the employee wage

wage = hours * rate

This line prints the calculated wage

print("Wages: ",wage)

The main starts here

def main():

The next four lines collects work hours, hourly rate, state of residence and marital status of the employee

hours = int(input("Work Hours: "))

rate = float(input("Hourly Rate: "))

residence = input("State of Residence: ")

status = input("Marital Status: ")

This line calls the Calculatewages() function

Calculatewages(hours,rate)

This line calls the main; This is where program execution starts

main()

User Ftexperts
by
4.5k points