This is a simple Employee Database Management Program implemented in C. This guide will walk you through the process of building and running the program.
Before you can build and run the program, you need to have a C compiler installed on your system. The GNU Compiler Collection (GCC) is a popular choice and is available on most systems.
First, ensure all source code files are located in the same directory. Then, open your terminal or command prompt, navigate to this directory, and execute the following command to compile the program:
clang database.c readfile.c -o main
Feel free to replace main with any name you prefer for the executable.
After compilation, run the program by providing a data file as a command-line argument:
./main input.txt
Feel free to replace "input.txt" with any file you prefer for the input.
The program menu offers the following options:
- Print the Database: Displays a table of all employees in the database, including their first name, last name, salary, and employee ID.
- Lookup by ID: Search for an employee by their Employee ID.
- Lookup by Last Name: Searches for an employee by their last name.
- Add an Employee: Allows you to add a new employee to the database by providing their first name, last name, and salary.
- Quit: Exits the program.
- Remove an employee: Allows you to delete an employee from the database.
- Update an employee's information: Enables you to update the employee's information.
- Print the M employees with the highest salaries: Print the top Mth salary, sorted by salary.
- Find all employees with matching last name: Return information for every employee whose last name matches case-insensitively.