Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Employee Database Your Program Must: Load the employees from the provided file o

ID: 3708460 • Letter: E

Question

Employee Database

Your Program Must:

Load the employees from the provided file o They must be stored in a map, where the key is the username of the employee and the value is the data for the employee

Give the user an interface to log in with a username and password o If it matches one of the entries from the file, output the data for that user o If it does not match, show an error message

If a user logs in and isManager for their profile is set to true: o

Employee Struct

struct Employee

{

char username[50]; char password[50]; int id;

char fullname[70]; double salary; bool isManager;

};


Show a list of all employees

Log logins and failed login attempts to a file named “access.log” o The existing contents of the file should be preserved between runs of the program

Example Input and Output elcome to the employee management system! Username: Password: jdoe passwd User found Your Profile: User ID: 101 Name: John Doe Salary: $650e0 Username: Password: mgarcia qwertyu Listing all employees: User ID: 152 Username: dsmith ame: David Smith Salary: $70000 User ID: 338 Username: imartinez Name: Isabella Martinez Salary: $65000 User ID: 101 Username: jdoe Name: John Doe Salary: $656e0 User ID: 32e Username: jjohnson ame: Ji11 Johnson Salary: $60000 User ID: 214 Username: mgarcia Name: Mary Garcia Salary: $80000 User ID: 321 Username: msmith Name: Mark Smith Salary: $55000

Explanation / Answer

Split up your data by topic. Think of tables as file folders in a filing cabinet. Identify the main topic headings for your data, and create tables for each distinct topic. For example, if you were running a business, you wouldn’t file your customer data in the same folder with suppliers’ addresses and price lists, nor would you mix accounts payable with receivables. Apply the same organizational logic to the information you plan to store in your Access database.

Give every item of data its own field. For example, many customers will have both a cell phone and a land line. You might be tempted to create a single “phoneNumber” field and put both numbers into it, separated by a comma. This is nevera good idea. Instead, create a “cellPhone” field and an “officePhone” field, and let each field hold a single item of data.

Put repeated items into separate tables. If your customer has two or more phone numbers, you should create distinct phone number fields in the customers table. But what if you need to record something that repeats indefinitely, such as customer orders (including customer order numbers)? If you stored them in the customers table, you’d have to create fields such as Cust_Order1, Cust_Order2, Cust_Order3, and so on, ad infinitum. The obvious problem here is that you don’t know how many orders you’ll need to provide fields for. This clearly indicates that you need to create a separate table just for orders. In a properly designed database, new data adds rows, not fields.

Put reusable information into separate tables. Any information that you’ll be entering multiple times is “reusable” information. Your goal in database design is to avoid entering the same data twice. Instead, find a way to reuse the data that’s already been entered. Not only does this save work, but it avoids data entry errors or discrepancies that will make it difficult to maintain a database.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote