Looking for advice /review on my code to see if I am missing any steps from the task, missing any code or made an error, and if so what? Task found below along with my written code. (Python) #Write Here class Wages: #Declare Methods def __init__(self, name, hours, wages): self.name = name self.hours = hours self.wages = wages #Determine Name def getName(self): self.name = str(input("Enter employee's name: ")) return self.name #Validate Weekly Hours def getHours(self): while True: try: self.hours = int(input("Enter number of hours worked: ")) if self.hours <= 0: print("Value must be a number greater than 0!") continue except EOFError: continue else: return self.hours #Validte Hourly Wage def getWage(self): while True: try: self.wages = int(input("Enter your hourly wage: ")) if self.wages <= 0: print("Value must be a number greater than 0!") continue except EOFError: continue else: return self.wages #Determine Weekly Pay def payForWeek(self): pay = self.getWage() * self.getHours() if self.getHours() > 40: overtime = 40 - self.getHours() pay += 0.5 * overtime return pay return pay cont = 'Y' while cont == 'Y': weekPay = Wage() print("This Program will create a class that stores an employees name and calculates weekly pay.") print("You entered that " + getName() + " worked " + getHours() + " hour(s) this week.") print("You entered that " + getName() + " earns $" + getWage() + " per hour.") print("Pay for " + getName() + " is $" + payForWeek()) print("Do you want to run the program again? ('Y' for yes, anything else to quit)") cont = input()
Looking for advice /review on my code to see if I am missing any steps from the task, missing any code or made an error, and if so what?
Task found below along with my written code. (Python)
#Write Here
class Wages:
#Declare Methods
def __init__(self, name, hours, wages):
self.name = name
self.hours = hours
self.wages = wages
#Determine Name
def getName(self):
self.name = str(input("Enter employee's name: "))
return self.name
#Validate Weekly Hours
def getHours(self):
while True:
try:
self.hours = int(input("Enter number of hours worked: "))
if self.hours <= 0:
print("Value must be a number greater than 0!")
continue
except EOFError:
continue
else:
return self.hours
#Validte Hourly Wage
def getWage(self):
while True:
try:
self.wages = int(input("Enter your hourly wage: "))
if self.wages <= 0:
print("Value must be a number greater than 0!")
continue
except EOFError:
continue
else:
return self.wages
#Determine Weekly Pay
def payForWeek(self):
pay = self.getWage() * self.getHours()
if self.getHours() > 40:
overtime = 40 - self.getHours()
pay += 0.5 * overtime
return pay
return pay
cont = 'Y'
while cont == 'Y':
weekPay = Wage()
print("This Program will create a class that stores an employees name and calculates weekly pay.")
print("You entered that " + getName() + " worked " + getHours() + " hour(s) this week.")
print("You entered that " + getName() + " earns $" + getWage() + " per hour.")
print("Pay for " + getName() + " is $" + payForWeek())
print("Do you want to run the program again? ('Y' for yes, anything else to quit)")
cont = input()
![Exercise 1: Employee Payroll firstname_lastname_CH10PE1
Write a program that asks for an hourly worker's name, hours worked, and hourly wage, and
then calculates their weekly pay.
The program should contain a class named Wages and follow the UML below.
Wages
name
hours
wages
_init_(name, hours, wages)
getName()
getHours()
getWage()
payForWeek()*
*Hint: Use an if statement to determine if you need to calculate regular or overtime pay. Return
formatted value.
Any hours worked over 40 should calculate at time and a half. This must be calculated
in the Wages object.
You must use the Wage's class methods to return name, wage, and hour. Hint: Return
the value formatted to the main so you can use the value in a print statement.
Modify the functions you used from Chapter 9 to do input validation and your run the
program again functions. Do not recreate the wheel.
Input validation should check for numbers and non-zero values. No input validation
needs to be completed on the name.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa9dcdc3c-6dc3-477b-85c7-36dea293e258%2F07e1c471-62c1-4d6d-9506-460698d73f3c%2Flw4jcc_processed.jpeg&w=3840&q=75)
![The program will create a class that stores an employees name and calculates weekly pay
Enter employee's name: Joseph Silman
Enter number of hours worked: a
Value must be a number greater than e!
Enter number of hours worked: -1
value must be a number greater than e!
Enter number of hours: 0
Value must be a number greater than 0!
Enter number of hours: 10
Enter your hourly wage: u
Value must be a number greater than 0!
Enter your hourly wage: -1
Value must be a number greater than 0!
Enter your hourly wage: e
Value must be a number greater than e!
Enter your hourly wage: 10
You entered that Joseph Silman worked 10.00 hour(s) this week.
You entered that Joseph Silman earns $10.00 per hour.
Pay for Joseph Silman is $100.00
Do you want to run the program again? ('Y' for yes, anything else to quit)
Y
The program will create a class that stores an employees name and calculates weekly pay
Enter employee's name: Joseph Silman
Enter number of hours worked: 45
Enter your hourly wage: 10
You entered that Joseph Silman worked 45.00 hour(s) this week.
You entered that Joseph Silman earns $10.00 per hour.
Pay for Joseph Silman is $475.00
Do you want to run the program again? ('Y' for yes, anything else to quit)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa9dcdc3c-6dc3-477b-85c7-36dea293e258%2F07e1c471-62c1-4d6d-9506-460698d73f3c%2Fyhrd81_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)