Question

Using Structures write an interactive program in C language to create an application
program for a small office to maintain the employee’s database. This application should
be having menu options like 

• Creating a New Record
• Reading/Listing of Records
• Modify the record
• Delete the record

Each employee record should have Employee Name, Employee ID, Department Name, Salary, Position,
Date of Joining, etc. The application should be designed user-friendly.

Note: You must execute the program and submit the program logic, sample input and output along
with the necessary documentation for this question. Assumptions can be made wherever necessary

13 Sep 2024
Answer :
Word Count : 1675

To design an interactive program in C that maintains an employee database for a small office, we will use structures to store employee details. The program will have a menu-driven interface with options to create, read, modify, and delete employee records. The data for each employee will include attributes like Employee Name, Employee ID, Department Name, Salary, Position, and Date of Joining.

### Key Features:
- Creating a New Record: This option will allow the user to input details of a new employee and save the record.
- Reading/Listing of Records: This option will display a list of all employee records stored in the system.
- Modify the Record: This option will allow the user to modify details of an existing employee.
- Delete the Record: This option will allow the user to remove a particular employee’s record from the system.

### Program Logic:

We will use a structure to represent each employee, and then implement the following functionalities:

- Add a new employee to the database (add to a list).
- Display all employees.
- Modify the details of an employee by Employee ID.
- Delete an employee record based on Employee ID.

Below is the C code that implements these features:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_EMPLOYEES 100

// Structure to store employee details
struct Employee {
    char name[50];
    int emp_id;
    char department[30];
    float salary;
    char position[30];
    char date_of_joining[15];
};

// Function declarations
void create_record(struct Employee* employees, int* emp_count);
void list_records(struct Employee* employees, int emp_count);
void modify_record(struct Employee* employees, int emp_count);
void delete_record(struct Employee* employees, int* emp_count);
void display_employee(struct Employee emp);

int main() {
    struct Employee employees[MAX_EMPLOYEES];
    int emp_count = 0;
    int choice;

    while(1) {
        // Displaying menu
____ _________ ___ ______ ______.
______ ______ __________ _______ ________.
____ _________ ____ ____ ________ ___.
___ ________ _________ ______ ________.
_______ _______ ____ ________ _____ ____ ________ __________ __________ ________ ____.
___ ___ ______ _______ ______ _________ ________ ____ ________.
_________ ___ ___ _____ ______ ________ __________ __________.
_____ ______ __________ _________ _____ ____ ___ ___ _____ _________ ______.
__________ __________ _____ ____ ___ ______ ________ __________ ________ _________ __________ ________.
_____ ___ _________ ____ _____ ___ ____ _________.
___ _________ ____ ____ _____.
__________ ____ _________ ______ _______ ____ ______ _____.
______ __________ _______ ______ _________ _____ ______ __________ _________.
__________ ________ _____ _______ ______ ___ _________ ___ ____ ______ ______ _________.
__________ ______ ____ ______ ______ ___.
______ ________ _____ _________ ________ ___ __________ _______ ______ ________.
____ ________ ___ ______ ___ ___ ______ _______ ______ _______ _________.
______ _______ _________ _______ __________ ________ __________ _______ __________ ___ ________ ______.
________ ______ __________ ____ __________ __________ __________ ______.
___ __________ ___ __________ _______ ____ _____ ________.
_________ ____ ____ _____ __________.
____ _____ _______ _______ _____ _______ _____ ___ ____.
________ _________ ____ ___ _______ __________ __________ __________ ______.
_________ ____ ____ ___ __________ ________ _______ _______ _________ ___.
_______ __________ ________ __________ ___ _____.
__________ _________ ____ _____ __________ ______ _______.
______ ______ ___ _____ ______ ________ _________ _____.
___ _____ _____ ______ __________ ____ ______ __________ _________ __________.
___ ______ ____ ______ ________.
__________ _____ _________ _________ _______ ___ ____ ________ ___ _________ __________ __________.
_____ _____ _____ ______ ______ _________ _______ ____ ___.
_______ ______ ____ __________ ______ ________ ___ _________ _________ ___ _________ _____.
____ _______ ___ ___ ________ _____ _________.
_______ _______ ________ ___ ________ ________ _____ __________ _____ __________ ______ ______.
______ ______ ____ ________ _____ _________ ______ _____ ________.
_________ _____ ___ __________ _______ __________.
_____ ______ ________ ________ ___ ____ ___ ______ ______ ________ ________.
__________ _________ ______ _____ ______ ___ ______ ______ ____.
______ ___ ___ _____ _______ _________ ____ __________ ___ _____.
______ _________ __________ ______ ___ _____ _____ _________ ________ __________ ___.
_________ ______ ________ ___ _________.
_________ __________ ___ ________ _________ ____ __________ _____ __________ _______ __________ ___.
____ _______ _________ _________ ___ _____.
__________ _______ ___ ____ ___ __________ _______.
____ ________ _______ ________ _________.
______ _____ _____ ______ ____ __________.
______ ____ ____ ___ ______ __________ ________ _______.
______ _________ ____ ___ ________ ___ ____ _______ __________ ___ ______ _______.
_______ _____ _____ ___ ______ __________.
__________ ____ _________ ____ ______ _____ ___ ______ _________ ____ _________.
__________ _______ ____ ____ ________ ______ __________.
_______ ___ _______ _________ __________ ________ _____ __________ ______ ________ _____ ______.
_______ __________ ________ __________ _________ ________ ___ ___ ______ ___ ____ ______.
_____ ___ ___ _________ __________ ______ ____ ___ ______ ________ ___ _____.
_____ ________ __________ ____ ____ ____ ______ ___ ___ _____ _____ _____.
______ ________ __________ _______ _______ ___ ________ _________ ______ __________.
____ ______ ________ ______ ________ _______ ____ __________ ___ _______ ___ ___.
_____ ___ _________ ____ _____ ________.
_______ ___ ________ __________ _______ _________ ____ _______ _________ ______ _________ _____.
_________ ____ _____ ______ ________ ________ ___.
________ ______ ______ _____ ___ ______ ______ ____ _______.
___ _______ ______ ___ _____ ___ ____ _______ ______ ______.
____ __________ _______ ___ __________ _________.
_________ ______ __________ ________ ____ ___.
_________ ________ ___ _________ ___ _______.
_________ ______ _____ ____ _______ ___.
_____ ____ __________ _________ ____ _____ ______ ______ _______ ______ _____.
__________ ____ __________ _____ _____.
_____ _______ ____ _____ ________ _____ __________ __________ ___ ____ __________.
___ _____ _____ _________ _____ _________ ____ ___.
__________ __________ __________ _________ _____ ___ ___ __________ __________ ___ ______.
_________ _____ __________ __________ _____ ___ _________ ______.
______ _________ ____ __________ ____ _______ ________ ________.
____ __________ ______ ________ __________ _________ ____ ____ _______ ____.
____ _______ _______ __________ __________ _____ ________ ______ __________ _________ ___.
____ ___ _____ ________ ___ ____ ____ ______ ___.
_____ ___ _______ __________ _____ __________ _________ ___ __________ ____ __________.
_______ _________ _____ ________ ________.
_________ _______ ______ ____ ______.
_________ _____ ________ __________ ___ _________.
_________ ________ ________ ___ ______ _____ ______ _____.
______ _______ ________ _________ ___.
________ ______ _________ ___ ________ _______ _______ _______ _________.
____ ____ ________ ____ _______ _____ ________ ___ _______.
_______ ________ ___ _______ ____ ______ ______ ________.
_________ ___ ____ _________ _______ __________ ________.
_____ __________ ___ _________ ______ _______ ____ ________ __________.
_____ _________ _____ __________ _____ ___ ____.
________ __________ ___ _____ ______ __________ ________ ______.
_____ ______ ______ ___ ________ _________ __________ __________ ___.
_______ ___ ________ ___ __________ ____.
____ _______ ______ _________ ________ ____ _________ __________ _________ _________ ______ ______.
_________ _____ _________ __________ _________ ____ _________.
_________ _________ ___ ___ _____ ____ __________ _________ ______.
___ ___ _______ ___ ______ _______ ___ _______ ____.
______ __________ _____ ___ ______ _____ _________ ________ ___ _______ ____.
___ ___ ________ ________ _________ _____.
___ __________ __________ ______ _____ _________ _________ ___ ___ __________.
_________ ________ _______ __________ ______ ________ _______ __________.
__________ _________ ________ _____ __________ ___ __________ ____ ________ ____.
___ _________ ________ ________ _________ __________ _________ _________ ___ _____ _______.
_______ ____ _________ ___ ___.
_____ __________ ______ _____ _____ _____.
_________ ________ ____ _____ ___ ___ _____ ________.
__________ _______ _____ _________ __________.
______ _______ _____ ________ ________ _________ ___ _____ ____.
___ ______ ______ ________ ________ ____ ________.
__________ ________ ______ _________ ___ ____ ___.
____ ________ ____ __________ _______ _____.
____ _______ _________ __________ _________ ______ ____ _______ _________ ______.
________ ________ _____ _____ ________ ____ _____ ______ _________ ______ _______.
_______ _________ __________ _________ ________ ______ _______ __________.
__________ _________ __________ ______ ________ __________ ________ _____.
___ ______ ____ _________ __________ _________ ______ ___.
____ _______ ____ ____ ______ _______ _______ _______ ______ ______ ____ ____.
_________ ____ _________ ______ ______ ____ _____ ____ _______ _____ ______ __________.
_____ __________ _____ ___ __________ __________ ____ _________ _______ _________ ____ ______.
_______ ___ ____ __________ _______ ___ _________.
________ ______ ______ _____ _____ ____ _________ ____ ___ _______ _________ _________.
__________ _______ ___ ______ ________ ______ ____ ________ __________ ______ ___ ____.
___ ____ ______ ____ _____ _____ _______.
_________ ___ _________ ___ _____ ________ ______ ____ ___ ________ _____.
_____ ___ _________ _______ _______ ___ _______ _____.
________ ________ ______ ________ _____ __________ ___ _____ ______ ________ ______ ______.
___ ____ ____ __________ _____ __________ __________ ________ ______ _____ ______.
_____ __________ ____ ___ __________ ____ ____ _________ ____.
________ _____ _____ ______ ______ __________.
________ ____ _______ _____ ___.
_________ _____ ___ ________ __________ ___ _______.
_______ ___ _________ ______ _____ _________ _________.
_________ __________ __________ ____ __________ _________ ________.
______ ____ ____ ______ ______ _______ _____ ________ _______ _____.
__________ _______ _________ ________ _____ _______ _____ ____ ____ _________ ______.
________ ____ _______ ___ ________ __________ ________ _______ __________.
______ _______ _________ ______ ______.
____ _____ ________ ___ _________ ____ ______ ___ _______ _________.
__________ ______ ____ _____ _______ _____ ____ __________ __________.
______ ______ ____ ______ ___ _______ __________ ___ _____ _____.
__________ _________ ______ ______ _____ ________ ___ _________ __________ __________ _______ _____.
_____ ____ __________ _______ _________ _______ _______.
______ _______ __________ __________ __________ _______ __________ ________ __________.
_____ _______ ______ ______ _________ _________.
_______ _________ _________ _______ __________ __________ __________ ______.
________ __________ ____ __________ __________ ___ _____ _________.
_____ ______ ___ ________ __________ ____ __________ _________ ___ _____ ______.
_________ ____ ______ ____ _______ ________ ______ _______ _______ ______ _____.
______ ____ ________ ___ _________ ________ _____ _____ ________ ___.
____ ________ _____ ________ _____ _______ __________.
___ ____ _________ ___ ___ ______ __________ _____ _______ ___ _____.
_____ ______ ___ _________ _________ ___.
_________ __________ _____ __________ _________ __________ _______ ______ _______ ____ _________.
_____ _______ ________ ___ ___ _________ _______ ________.
_____ _________ ___ ______ ________ ______ _________.
________ __________ ___ ________ _________ _________.
________ ______ _____ _____ ____ _________ ______.
_____ ____ _____ _________ ______ ______ _________ ____ _______ _________.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Using Structures write an interactive program in C language to create
🟢
WhatsApp Chat Fast live messaging
Email Us Business enquiries & support