UML Diagram of class Employee

Screenshot(employee_App)




Program(employee_App.py)
from employee import Employee
import os.path
from os import path
#function display user choices and return correct choice
def getMenu():
print("OPTIONS:\n-------")
print('1. Look up an employee\n2. Add a new
employee\n3. Change an existing employee\n4. Delete an employee\n0.
Quit\n')
opt=int(input('Enter your choice: '))
while(opt<0 or opt>4):
print('ERROR!!!Option
should be 0-4.Try again!!!')
opt=int(input('Enter
your choice: '))
return opt
#Function read data from file and add into dictionary of
employee
#Her key is employee id
def readData(employees):
file1 = open('employees.dat', 'r')
while True:
line = file1.readline()
.strip()
if not line:
break
line=line.split(',')
employees[line[1]]=Employee.add(line[0],line[1],line[2],line[3])
file1.close()
#Search an employee in dictionary using id
#If found display employee details
#Otherwise eroor message
def lookUp(employees):
id=input('\nEnter employee id for look up:
')
if id in employees:
print(employees[id])
else:
print(id,' not
present!!!')
#Add a new employee in dictionary
#Check already present before add
def addEmployee(employees):
id=input('\nEnter employee id: ')
if id in employees:
print('Already
present!!!')
else:
name=input('Enter
name: ')
dep=input('Enter
department: ')
title=input('Enter
job title: ')
emp=Employee()
emp.add(name,id,dep,title)
employees[id]=emp
print('Added a new
employee!!!')
return employees
#Update name,department and title of an employee using id
def updateEmployee(employees):
id=input('\nEnter employee id: ')
if id in employees:
name=input('Enter
name: ')
dep=input('Enter
department: ')
title=input('Enter
job title: ')
emp=Employee()
emp.add(id,name,dep,title)
employees[id]=emp
print('Change
employee with id ',employees.get(id).ID_number)
else:
print(id,' not
present!!!')
return employees
#Remove an employee from dictionary using id
def deleteEmployee(employees):
id=input('\nEnter employee id to delete
')
if id in employees:
employees.pop(id)
print(id,'
removed!!')
else:
print(id,' not
present!!!')
return employees
#Write dictionary details into file
def writeData(employees):
file1 = open('employees.dat', 'w')
for id in employees:
file1.write(employees[id].name+','+employees[id].ID_number+','+employees[id].department+','+employees[id].job_title+'\n')
file1.close()
#Main function
def main():
#Display header
print('***** Welcome To Employee App
*****\n')
#Create a dictionary
employees={}
#Check file exist
if path.exists('employees.dat'):
readData(employees)
#Call menu
opt=getMenu()
#Loop until exit
while opt!=0:
#Each options
if(opt==1):
lookUp(employees)
elif opt==2:
employees=addEmployee(employees)
elif opt==3:
employees=updateEmployee(employees)
elif opt==4:
employees=deleteEmployee(employees)
#repetittion
print()
opt=getMenu()
#Write into file
writeData(employees)
#Start here
if __name__=="__main__":
main()
Screenshot(employee.py)

Program(employee.py)
class Employee():
#Constructor
def __init__(self):
self.__name=""
self.__ID_number=""
self.__department=""
self.__job_title=""
#Add an employee
def add(self,name,id,depart,title):
self.name=name;
self.ID_number=id
self.department=depart
self.job_title=title
#Search an employee using id
def search(self,id):
return
self.ID_number==id
#Setters
def setName(self,name):
self.name=name
def setDepartment(self,depart):
self.department=depart
def setTitle(self,title):
self.job_title=title
#Display en amployee in string format
def __str__(self):
return "Name: %s, ID: %s,
Department: %s, Job title:
%s"%(self.name,self.ID_number,self.department,self.job_title)
Output
***** Welcome To Employee App *****
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 1
Enter employee id for look up: e1
e1 not present!!!
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 2
Enter employee id: e1
Enter name: Kaisy
Enter department: EC
Enter job title: Junior PC
Added a new employee!!!
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 1
Enter employee id for look up: e1
Name: Kaisy, ID: e1, Department: EC, Job title: Junior PC
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 3
Enter employee id: e1
Enter name: Kaisy
Enter department: EC
Enter job title: Senior
Change employee with id Kaisy
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 1
Enter employee id for look up: e1
Name: e1, ID: Kaisy, Department: EC, Job title: Senior
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 4
Enter employee id to delete e1
e1 removed!!
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 1
Enter employee id for look up: e1
e1 not present!!!
OPTIONS:
-------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
0. Quit
Enter your choice: 0
Press any key to continue . . .
1. Write a class named Employee that holds the following data about an employee in attributes:...
please make sure to write down all the coding and the output for it
and to do all three steps
Student Name: 1. Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. (employee.py) 2. Create a UML diagram for Employee class. (word file) 3. Create a program that stores Employee objects in a dictionary. Use the employee ID number as the key. (employee_App.py) The program should present...
Part 1 (employee.py): Write a class name Employee that holds the following data about an employee in attributes:name, ID number, department and job title. Once you have written the class, write a program that creates three Employee objects to hold the following data: The program should store this data in the three objects, then display the data for each employee on the screen as a table like this (Use fstring or "format" function to format the output as a table,...
Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. Don't include a constructor or any other methods. Written in Python and formatted like it says below!!!!! Once you have written the class, write a program that creates three Employee objects to hold the following data: Name ID Number Department Job Title Susan Meyers 47899 Accounting Vice President Mark Jones 39119 IT Programmer Joy Rogers 81774 Manufacturing Engineering...
Using C++, Write a class named Employee that has the following member variables: name. A string that holds the employee's name. idNumber. An int variable that holds the employee's ID number. department. A string that holds the name of the department where the employee works. position. A string that holds the employee's job title. The class should have the following constructors: A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: employee's name,...
Design and write a class named Employee that inherits the Person class from the previous exercise and holds the following additional data: ID number, department and job title. Once you have completed the Employee class, write a Python program that creates three Employee objects to hold the following data: Name ID Number Department Job Title Phone Susan Meyers 47899 Accounting Vice President 212-555-1212 Mark Jones 39119 IT Programmer 212-555-2468 Joy Rogers 81774 Operations Engineer 212-555-9753 The Python program should store...
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...
It must be C++
Chapter 13 Programming Challenge 2: Employee Class.
See instruction: Chapter 13 Programming Challenge 2 Employee
Class.pdf
Program Template:
// Chapter 13, Programming Challenge 2: Employee Class
#include <iostream>
#include <string>
using namespace std;
// Employee Class Declaration
class Employee
{
private:
string name; // Employee's name
int idNumber; // ID number
string department; // Department name
string position; // Employee's position
public:
// TODO: Constructors
// TODO: Accessors
// TODO: Mutators
};
// Constructor #1
Employee::Employee(string...
Create a c++ code and answer number 1
Homework Ch. 13 - Employee Class 30 points Design a class named Employee that has the following attributes: * Name ID Number- (Employee's] Identification Number " Department-the name of the department where the employee works " Position-the employee's job title The class should have the following constructors: A constructor that accepts values for all the member data as arguments A constructor that accepts the following values as arguments and assigns them to...
Create a C# Console program. Add a class named Employee that has the following public fields: • Name. The name field references a String object that holds the employee’s name. • IDNumber. The IDNumber is an int that holds the employee’s ID number. • Department. The department field is a String that holds the name of the department where the employee works. • Position. The position field is a String that holds the employee’s job title. Once you have written...
Part 1 Start by designing the Employee class Employee holds the following private attributes: a count of employees (a static variable called NUM_EMP)* an employee’s last name an employee’s first name an employeeNumber (a String that is unique – that will use the NUM_EMP)* a department a jobTitle an annual salary (e.g., 45000). NOTE: *NUM_EMP should start off as zero and get updated every time a new Employee is created. The employeeNumber always starts with empl_ followed by the current...