ASAP Please.
Python Program
Description
Create an object-oriented program that allows you to enter data for employees.
Specifications
Sample Output (Your output should be similar to the text in the following box)
Welcome to my app EMPLOYEE DATA ENTRY Manager or Representative? (m/r): d Invalid selection. Continue? (y/n): y Manager or Representative? (m/r): m First Name:
Frank Continue? (y/n): y Manager or Representative? (m/r): r First Name: John Continue? (y/n): n EMPLOYEE
INFORMATION Thank you for using my app |
Code is as follows:
*********************************************************************************************************************************************
from abc import ABC, abstractmethod
class Employee(ABC):
def
__init__(self,firstName,lastName,emailId,socialSecNumber):
self.__firstName = firstName
self.__lastName = lastName
self.__emailId = emailId
self.__socialSecNumber = socialSecNumber
def getFirstName(self):
return self.__firstName
def setFirstName(self,firstName):
self.__firstName = firstName
def getLastName(self):
return self.__lastName
def setLastName(self,lastName):
self.__lastName = lastName
def getEmailId(self):
return self.__emailId
def setEmailId(self,emailId):
self.__emailId = emailId
def getSocialSecNumber(self):
return self.__socialSecNumber
def setSocialSecNumber(self,socialSecNumber):
self.__socialSecNumber = socialSecNumber
@abstractmethod
def get_net_income(self):
return 0
class Manager(Employee):
def
__init__(self,firstName,lastName,emailId,socialSecNumber,yearsOfExperience,annualSalary):
super().__init__(firstName,lastName,emailId,socialSecNumber)
self.__yearsOfExperience = yearsOfExperience
self.__annualSalary = annualSalary
def getYearsOfExperience(self):
return self.__yearsOfExperience
def setYearsOfExperience(self,yearsOfExperience):
self.__yearsOfExperience = yearsOfExperience
def getAnnualSalary(self):
return self.__annualSalary
def setAnnualSalary(self,annualSalary):
self.__annualSalary = annualSalary
def get_net_income(self):
bonus = self.__yearsOfExperience*1000
grossIncome = self.__annualSalary+bonus
tax_rate = 0.3
income_tax = grossIncome * tax_rate
net_income = grossIncome - income_tax
return net_income
class Representative(Employee):
def
__init__(self,firstName,lastName,emailId,socialSecNumber,weeklyHoursOfWork,payRate):
super().__init__(firstName,lastName,emailId,socialSecNumber)
self.__weeklyHoursOfWork = weeklyHoursOfWork
self.__payRate = payRate
def getWeeklyHoursOfWork(self):
return self.__weeklyHoursOfWork
def setWeeklyHoursOfWork(self,weeklyHoursOfWork):
self.__weeklyHoursOfWork = weeklyHoursOfWork
def getPayRate(self):
return self.__payRate
def setPayRate(self,payRate):
self.__payRate = payRate
def get_net_income(self):
gross_income = self.__weeklyHoursOfWork * 52 * self.__payRate
tax_rate = 0.2
income_tax = gross_income * tax_rate
net_income = gross_income - income_tax
return net_income
print('Welome to my app')
print('EMPLOYEE DATA ENTRY')
employees = []
cont = 'y'
while(cont == 'y'):
choice = input('Manager or Representative? (m/r):')
while(choice!='m' and choice != 'r'):
print('Invalid selection.')
cont = input('Continue? (y/n):')
if(cont=='y'):
choice = input('Manager or Representative? (m/r):')
else:
cont = 'n'
break
if(cont=='y'):
firstName = input("First Name:")
lastName = input('Last Name:')
emailId = input('Email Address:')
socialSecNumber = input('SSN:')
if(choice=='m'):
yearsOfExperience = int(input('Years of Experience:'))
annualSalary = float(input('Annual Salary:'))
a =
Manager(firstName,lastName,emailId,socialSecNumber,yearsOfExperience,annualSalary)
employees.append(a)
if(choice=='r'):
weeklyHoursOfWork = int(input('Weekly Hours of Work:'))
payRate = float(input('Pay Rate:'))
a =
Representative(firstName,lastName,emailId,socialSecNumber,weeklyHoursOfWork,payRate)
employees.append(a)
cont = input('Continue? (y/n):')
print('EMPLOYEE INFORMATION')
if(employees == []):
print('There is nothing to print')
else:
for emp in employees:
print(emp.getLastName()+','+emp.getFirstName()+','+emp.getEmailId()+','+emp.getSocialSecNumber()+',
$'+str(emp.get_net_income()))
print('Thank you for using my app')
*********************************************************************************************************************************************
screenshot of the code:
Output:
ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...
This is for Java Programming Please use comments Customer and Employee data (15 pts) Problem Description: Write a program that uses inheritance features of object-oriented programming, including method overriding and polymorphism. Console Welcome to the Person Tester application Create customer or employee? (c/e): c Enter first name: Frank Enter last name: Jones Enter email address: frank44@ hot mail. com Customer number: M10293 You entered: Name: Frank Jones Email: frank44@hot mail . com Customer number: M10293 Continue? (y/n): y Create customer...
Use python to create this program. 1) Employee Class Write an Employee class that keeps data attributes for the following pieces of information: Note: For all classes, the attributes must be hidden Employee Name Employee Number Hire Date Create accessors and mutators Attributes should be hidden. Create a class attribute that determines a standard pay rate adjustment 4% for raises 2) ProductionWorker Class Write a class named ProductionWorker that is a subclass of Employee that holds the following attributes .Shift...
The purpose of this lab is to practice the concept of inheritance. We will create an Hourly class that is an Employee class. In other words, the Hourly class inherits from the Employee class. In addition, we will create a Salary class that inherits from the Employee class. Finally, we will make a Child class work as a Parent class. We will create a Manager class that inherits from the Salary class. Create a C++ project, and call it Week...
Description Create an object-oriented program that uses inheritance to perform calculations on a rectangle or a square. Sample Output (Your output should be similar to the text in the following box) Rectangle Calculator Rectangle or square? (r/s): r Height: 5 Width: 10 Perimeter: 30 Area: 50 Continue? (y/n): y Rectangle or square? (r/s): s Length: 5 Perimeter: 20 Area: 25 Continue? (y/n): n Thank you for using my app Specifications Use a Rectangle class that provides attributes to store the...
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...
Part (A) Note: This class must be created in a separate cpp file Create a class Employee with the following attributes and operations: Attributes (Data members): i. An array to store the employee name. The length of this array is 256 bytes. ii. An array to store the company name. The length of this array is 256 bytes. iii. An array to store the department name. The length of this array is 256 bytes. iv. An unsigned integer to store...
Create an abstract class Employee. Your Employee class should include the following attributes: First name (string) Last name (string) Employee id (string) Employee home street address (string) Employee home city (string) Employee home state (string) Write a constructor to initialize the above Employee attributes. Create an abstract method called earnings. Create another class HourlyEmployee that inherits from the abstract Employee class. HourEmployee must use the inherited parent class variables and add in attributes HourlyRate and HoursWorked. Your HourEmployee class should...
Create an abstract class Employee. Your Employee class should include the following attributes: First name (string) Last name (string) Employee id (string) Employee home street address (string) Employee home city (string) Employee home state (string) Write a constructor to initialize the above Employee attributes. Create an abstract method called earnings. Create another class HourlyEmployee that inherits from the abstract Employee class. HourEmployee must use the inherited parent class variables and add in attributes HourlyRate and HoursWorked. Your HourEmployee class should...
Java Description Write a program to compute bonuses earned this year by employees in an organization. There are three types of employees: workers, managers and executives. Each type of employee is represented by a class. The classes are named Worker, Manager and Executive and are described below in the implementation section. You are to compute and display bonuses for all the employees in the organization using a single polymorphic loop. This will be done by creating an abstract class Employee...
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,...