Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program that monitors the entry of a new employee, if an employee has been removed and checks the employees information. The data is

Create a program that monitors the entry of a new employee, if an employee has been removed and checks the employees information.

The data is stored in a file with the next structure:

Employees number, this number cant be repeated. Is made up of only numbers

Name, last name. It must be stored in CAPITAL LETTERS no matter how it is entered.

Pay, the employees pay is between 10,000 and 20,000.

When the option of entry is selected it must ask for the employees data until the employee number is 'X'

The option to check the employee information asks for the employee's number and shows its data if the employee exists, if not it must show a message saying that the employee does not exists

To remove an emplyee it must ask for the employee's number, show its data and ask for confirmation

A report is also required, it must show the employee with the lowest pay, with the highest pay and calculate the average pay. It will also create a plot graph which will only show on screen.

image text in transcribed

import matplotlib.pyplot as plt import os.path as path import sys file "file data.txt" - def menu) print("nMENU EXAMEN FINAL") print ("\t1) Entry of a new employee") print("\t2) check employee's data") print(t3) remove an employee) print("t4) Report") print("It5) finish") def entry): #Checks that the employee does not exist, this with the employee's number #Asks for the new employee's data so they can be saved in the file #Makes use of save-employee(data) def save_ employee(data): #saves an individual employee, gets a string with the data separated by a def save_data(data): #When an employee IS removed, this function erases the file and creates the file again with all the data that didnt erase def create_matrix(): #creates a list with the data in the txt file def employee_exists): #returns a booLean value, True ?f it erists and False if it does not exist def check (employee_number): #Looks for an employee with the employees number and prints the employee's name and pay #if it does not exist, prints the corresponding message def remove (employee_number): #Looks for the employee, if it exists asks for confirmation #if it does not exists prints an adequate message def highest pay): #gets the highest pay def lowest_pay(): #gets the lowest pay def average_pay) #gets the average pay def report(): #Shos the highest pay, lowest pay, and the average #creats a plot graph with the pay data #### MAIN try: menu except print( 'An error happened. .. '. sys.exc info())

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

What is the wireless application protocol (WAP)?

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago