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

__________ _______ ____ ______ _________ _______ ___ __________ _____.
_______ ________ _____ __________ _____.
_______ _____ __________ ______ ______ _____ _____ __________ ______.
_______ _______ _________ ________ ______ ______.
__________ __________ ______ ___ ______ ____ ___ ___.
__________ _________ ____ ___ ___ ____ _________.
______ _____ _______ _____ ________ ______ __________.
_____ _________ __________ ______ ____ ________ ____ _____ ____ ___.
______ _____ __________ ___ ___ ______ ___ __________ __________ _________ ___ _______.
______ ________ __________ _______ ____ _____ __________ _________.
___ ______ _________ ________ _____ ___ _______.
_________ _____ _______ _________ ________ _____ ________ __________ __________ __________.
_________ _____ ________ __________ _______ _________ ____.
_______ __________ ________ _______ ___ ______ _______ _______ _____.
______ ____ ____ __________ ___ ______ ___ _______.
____ _________ __________ __________ _____ _________ _______ _____ __________ ____.
_______ __________ ______ ___ _______ ____ __________ _________ ______.
__________ _________ ____ ___ _________.
_________ ____ ___ __________ ____ _________ _____ _________ ______ _______.
_____ ____ __________ ___ ___ ________ ____.
_______ ______ _______ __________ __________ _______ ___ ___ _______ _________ __________ _____.
___ _____ _____ ___ ______ ___ _____ ____ ________ _______ _______ ___.
_________ ___ _____ _______ _________ ____.
_______ _________ _______ __________ _________.
_____ ___ _________ _____ ______ ___ _______ ___ ____ _________.
___ ______ _______ ____ ________ ______ ______ _____ ______ ______ ___ ____.
____ _________ __________ ___ _____ _________ ___ ______ ______ _________ ____.
____ _______ _____ ______ _____ __________.
_____ _______ _________ _______ _____ ______ __________.
_________ _____ _________ _______ ___ _______ ________ ___.
_________ ____ __________ __________ _____ _________ __________ ______.
_______ ______ ____ ________ ______ _________ ____ __________ _______ _____ __________ __________.
___ ______ ________ ___ _____ ___ ________ ________ _________ ______ _____.
______ _____ _____ __________ ______ __________ ______ ____ __________ ___ ____.
______ _________ ____ ___ _________ ___.
____ ____ _______ _________ _____ _________ ________ _________ _____ ______ _________.
______ _____ ___ ______ _____ ________ ____.
______ _________ ________ ___ ____ ___ __________ ________ ____ _______.
______ ____ _________ _________ _____ _______ _______ ________ _________ ____ ____.
__________ _______ __________ _____ __________.
_______ ______ __________ ________ ______ ___ _____ ____ __________ ___ _______.
______ __________ _______ ______ _________ ________ __________ ______ _______ ___.
_______ ________ _______ ________ ____ ____ _____ _______ _______ ____ _______.
________ ___ ___ __________ ____ ___ _____ _____ ______.
________ __________ ___ _______ __________ _____ _______ ____ ________.
_______ _________ ________ _______ __________ ____ _____ ______.
________ ________ _____ _____ ________.
____ _______ __________ ________ _____ _________ __________ _____ ___ __________ _____ _________.
____ ___ ______ ______ _______ _________ ___ ________.
____ ____ _______ ____ ___ ______ _____ ________ ___ ___ _________.
_____ _______ ________ ________ ________ ___ ______ _____ _______ ______ ______ _______.
_____ ________ ____ _________ _____ ________ ____ __________.
________ ______ _________ ______ ______ ________ _________.
___ _________ _______ _________ _________ __________ ___.
__________ ___ __________ __________ _______ __________ ____ ________ ___ _______ _______ ____.
______ ______ __________ ________ __________.
_____ __________ _____ _______ __________ _______.
_______ _________ ____ _________ ____ ____ ______ ___ __________ ____ __________ ____.
____ ____ ________ _____ __________ ______ __________ ______ _________ _________ _______ ________.
_________ ___ ______ __________ ___ ______ ____ _________ ___ _____ ___ ______.
_________ ___ ______ ______ _________.
_________ _____ ___ _______ ____.
_________ __________ _____ __________ ______ ____ _________ ___ ___ ___ _______ _____.
________ __________ ______ ___ ________ __________.
__________ ______ ___ _______ ________ __________ ________.
_________ ___ ___ ________ __________ __________ _____ ________.
____ __________ ____ ____ _________ _____ _______ ________.
_____ ________ ______ ____ ____ ___ _________ _______ _______.
___ ___ ________ _______ _________ ___ _______ _________.
___ ___ _______ ______ ______.
________ ___ ____ ________ ________ __________.
____ __________ _________ _____ ______ ________.
_________ ________ _____ ___ ______ ____ __________ _____ ___ ________.
____ _____ _____ _____ ________ ___.
_____ __________ __________ _______ _________ _________ ________ ___.
_____ ______ _____ _________ __________ _____.
_____ ____ ___ ________ _______ ________ ________.
_________ _________ _____ ________ _____ ______ _____ _______ ____ ___ ______ ____.
________ _______ __________ _________ _________ __________ _____ __________ ________ ____ ___.
______ _________ _______ ______ _______ ______ __________ _______ __________ ___.
_______ ____ _____ ______ ___.
__________ _____ ___ ___ ________ ____.
________ __________ _________ __________ ______ ________ ___ _______ ___.
_______ ___ _________ ___ _______ ________.
_____ ______ _____ ____ _________ _____ _______ ______ __________ ________ __________ ____.
__________ ______ ______ _________ _________ ___ ____ _________.
_________ ___ ____ _____ _____.
________ ________ ________ ___ __________ ______ ___ _________ ___ ______ _____.
____ ________ _________ ___ _________ ___ ______ ______.
______ _____ ____ _______ _________ _________ __________ ____ ___.
_________ _____ ___ ________ ___ ____ _____.
____ ____ _____ _______ ____ ________ __________ ____ ________ ____ ___.
____ ______ _____ _____ ________ ______ __________ ___ _________ __________ _____.
__________ ______ ________ _______ ________ _________ __________ _______.
_____ _______ ___ ___ _____ ___ __________ _________.
__________ ___ ___ ____ ______ __________.
________ _______ ___ ________ _________ _____ ______ _________.
____ _________ ______ _______ __________ _____ __________ _______ ___ ________.
______ ___ ______ _______ __________.
________ _______ ___ ____ _____ _________.
___ _______ ________ ________ ________ ______ _____ ______ _____ _____ __________ _________.
________ _________ ______ ______ _________ _______ ___ __________ _____ ______.
_________ __________ _________ _____ __________ _________.
__________ ___ ________ __________ ____ ______ ________ ________ _________ __________.
___ ______ __________ __________ ________ ____ _____ _______ __________ ________.
_______ ______ ________ ______ ________ _________ ________.
__________ _____ ________ __________ _______.
________ ____ ________ ____ __________ ____ ____ ______ ________ ________ ___.
_____ ________ ________ ____ ____.
___ _________ ______ ______ ____ ___ ________ ___ ____.
_________ ______ _______ _________ _______.
_______ _____ __________ ________ _____ __________ ___ ___ ________ __________.
__________ _____ ________ __________ _____.
_____ ______ _____ ____ ______ _________ ________.
______ ________ _______ _______ ______ ________ _________ _____ ________.
______ ___ ____ _______ ________.
______ _______ __________ ___ ____ _______ ________ __________.
____ ____ ____ ______ __________ ____ ________.
_____ _______ __________ __________ __________.
__________ __________ _________ ___ ____ _______ _____ __________ _________.
__________ _______ ________ _______ ___ __________ _____ ______ ______ _____ _______ _____.
_____ __________ __________ _________ ______.
____ _____ _________ __________ _________ _______ ______ ______.
__________ _______ ______ __________ ____ __________ __________ _________ _________ ______.
__________ _________ ___ ______ _________ _______ ___ ____ ______.
_______ ______ ______ _____ _________ _____ __________ ________ ____ ____.
____ ______ _________ _______ ________ ______ _________ ______.
__________ _______ _____ _____ ______ __________.
_________ ________ ______ ___ ____ __________ ______.
_____ _________ ________ _______ _________ _____ ___ ____ ____ ____ ______ _____.
__________ ______ _______ _________ _________ ______ ____ __________ ____ _______ __________ ____.
____ _______ ________ ___ ___ _____ ____ ______ ______ __________.
_____ _____ ______ _________ ________ ________ _________ ______ ______ ____ _________.
_________ ______ _________ ______ _______ ______ _______ ________ ____ ___ _______.
_______ _________ ______ __________ _______ ________ ________ ___ ________ __________ ___.
__________ _________ _____ ______ _______ ______ ____ __________.
____ ______ ___ __________ ________ _________ ____ ____ _____ ___ _________.
_____ _________ _____ _____ _____ ___ ____.
_______ ______ _____ _____ ________ _____ ____.
_______ _____ ____ ______ _____ ____ _______ ______ ______.
___ _________ ________ ___ ______.
_____ _______ __________ _______ _____ _______ _____.
__________ _______ __________ _____ _______.
_________ ___ _____ ____ _______ ______ _______ ________ _____ _______.
____ __________ __________ _______ ____.
___ _________ ____ _________ ______.
____ __________ ______ __________ _________ __________ ______ _____ _______ __________ __________ ___.
____ ___ ______ ___ ___ ____ ____.
_____ _______ ________ _______ ____ ___ ____ ________ ______ ___.
______ __________ __________ ____ ______.
__________ ______ _____ _____ ___ _____.
_________ __________ ______ _________ ____ __________ __________.
_______ _______ _________ ______ ______ ______ _______ _____ ___ _______.
__________ ________ ___ __________ _________ ________ _______ _____ ____ ____.
___ _______ __________ _______ _____ _______ ____.
_________ _________ _______ ___ _________ __________ _________.
________ __________ _______ _______ _______ ___ ________ __________.
________ _________ ______ ________ ___ _________ _______ ________.
___ _____ ____ _______ _________.
________ _______ _________ ____ _____ _____ __________.
________ _________ __________ _________ ____ _____.
______ __________ _____ _________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCSL 205 2024 - Using Structures write an interactive program in C language to create | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→