Question

help asap in python codio, A good friend of yours owns a small company that produces...

help asap in python codio,

A good friend of yours owns a small company that produces a tool the helps disabled individuals open jars and containers. Rather than buy a time clock mechanism, he would like to put an old computer on the warehouse floor that could be used as the time clock and help them manage materials, shipments, etc. Your friend was able to find an inexpensive application to keep track of each employee’s hours. However, this application did not contain the code to determine how much each employee needs to get paid at the end of the week. Therefore, he has come to you for some help. He would like you to develop a small application that would accept the total number of hours worked and the hourly rate for his employees. The program would then calculate the total pay. You will need to use the following equations to determine net pay:

Gross Pay = Hours Worked * Pay Rate
Deductions = Gross Pay * 0.35
Net Pay = Gross Pay – Deductions

Create a class to solve the problem listed above. Name your class NetPay. Your class will need the number of hours worked and the pay rate when the object is created. Your class will need to store these values in attributes called: hours and rate. Additionally your class will need to return the gross pay, the amount in deductions and net pay. Store these values in attributes called gross, deductions and net. In order to create these values you will need to write the following methods: GetGrossPay, GetDeductions and GetNetPay. Within these methods, your code will perform the appropriate calculation and return the value generated. In the GetNetPay method you will need to call the the GetGrossPay and GetDeductions methods. To do this you will need to enter the following code:

self.GetGrossPay()
self.GetDeductions()

When creating this class you may want to start coding in VS Code or Python. After you have coded your class, create an object to test your class. If you send in 20 for hours worked and 15 for rate, when you call your methods and print them, your program will print out the following:

300
105.0
195.0
0 0
Add a comment Improve this question Transcribed image text
Answer #1

class NetPay:
def __init__(self,hours,rate):
self.hours=hours
self.rate=rate
def GetGrossPay(self):
self.GrossPay=self.hours*self.rate
return self.GrossPay
def GetDeductions(self):
self.Deductions=self.GetGrossPay()*.35
return self.Deductions
def GetNetPay(self):
self.NetPay=self.GetGrossPay()-self.GetDeductions()
return self.NetPay
  

netPayObject=NetPay(20,15)
print(netPayObject.GetGrossPay())
print(netPayObject.GetDeductions())
print(netPayObject.GetNetPay())

Add a comment
Know the answer?
Add Answer to:
help asap in python codio, A good friend of yours owns a small company that produces...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The...

    Python 3 Question Please keep the code introductory friendly and include comments. Many thanks. Prompt: The owners of the Annan Supermarket would like to have a program that computes the weekly gross pay of their employees. The user will enter an employee’s first name, last name, the hourly rate of pay, and the number of hours worked for the week. In addition, Annan Supermarkets would like the program to compute the employee’s net pay and overtime pay. Overtime hours, any...

  • Create the Python code for a program adhering to the following specifications. Write an Employee class...

    Create the Python code for a program adhering to the following specifications. Write an Employee class that keeps data attributes for the following pieces of information: - Employee Name (a string) - Employee Number (a string) Make sure to create all the accessor, mutator, and __str__ methods for the object. Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: - Shift number (an integer,...

  • ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...

    ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...

  • write in java and please code the four classes with the requirements instructed You will be...

    write in java and please code the four classes with the requirements instructed You will be writing a multiclass user management system using the java. Create a program that implements a minimum of four classes. The classes must include: 1. Employee Class with the attributes of Employee ID, First Name, Middle Initial, Last Name, Date of Employment. 2. Employee Type Class that has two instances of EmployeeType objects: salaried and hourly. Each object will have methods that calculates employees payrol...

  • Help with Python code. Right now I'm creating a code in Python to create a GUI....

    Help with Python code. Right now I'm creating a code in Python to create a GUI. Here's my code: #All modules are built into Python so there is no need for any installation import tkinter from tkinter import Label from tkinter import Entry def calculatewages(): hours=float(nhours.get()) nsal=float(nwage.get()) wage=nsal*hours labelresult=Label(myGUI,text="Weekly Pay: $ %.2f" % wage).grid(row=7,column=2) return Tk = tkinter.Tk()    myGUI=Tk myGUI.geometry('400x200+100+200') myGUI.title('Pay Calculator') nwage=float() nhours=float() label1=Label(myGUI,text='Enter the number of hours worked for the week').grid(row=1, column=0) label2=Label(myGUI,text='Enter the pay rate').grid(row=2, column=0)...

  • Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to...

    I need some help with programming this assignment. Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to write a Python class Be able to define class attributes Be able to define class methods .Be able to process input from a text file .Be able to write an application using objects The goal of this programming assignment is to develop a simple image processing application. The application will import a class that creates image objects with...

  • C++ HELP! Create a class and name it Payslip. This class should have the following attributes...

    C++ HELP! Create a class and name it Payslip. This class should have the following attributes or properties: name, pay grade, basic salary, overtime hours, overtime pay, gross pay, net pay and withholding tax. Define the accessors and mutators of the Payslip class based on its attributes or properties. This class should also have the following methods: determinePayGradeAndTaxRate and computePay. Create another class and name it Employee. This class will contain the main method. In the main method, instantiate an...

  • Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code:...

    Introduction to computer class, Java programming through eclipse: Ue the following criteria to create the code: SALARY Input first and last name - Output the names last, first in your output - Make the federal withholding rate a constant 20% (not an input value) No state tax Generate two new values: regular pay and overtime pay - 40 hours workedor less - Regular pay is pay rate * hours worked - Overtime pay is 0 Otherwise - Regular pay is...

  • A program is needed to compute paychecks for employees. It needs to compute a weekly paycheck...

    A program is needed to compute paychecks for employees. It needs to compute a weekly paycheck based upon the hourly rate and number of hours worked by the employee. Create a class that can be used for this purpose. You simply need to create the class that has attributes and methods that would allow this. It does not need a main() method.

  • My Java code from last assignment: Previous Java code: public static void main(String args[]) { //...

    My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT