×

Fee Management System in C

The concept is to split every operation into its very own characteristic. Software is made from all of the capabilities mixed with transfer cases. An example of the capabilities may be observed below:

1. execute():

This characteristic will use Switch Statements to perform the subsequent capability and show the software's to be had options.

Functionality: Show Eligible Students Add Student Details Delete Student Record Update Eligibility Criteria Print Student Details.

2. add():

This characteristic receives facts from the person and updates the college students' listing. Verify that the student’s Roll Number is precise earlier than including the student to the listing. The college students to be added specifics are as follows:

Name of the student, the roll number, the fame of the fees, and the attendance report of eligible.

3. Students():

This characteristic receives facts from the person, updates the eligibility for the exams, and presentations the specified percent of preceding attendance for exams. By iterating over the listing of student records, it additionally updates the price fame required for examination eligibility. For every student, it assessments to peer if their attendance percent exceeds the specified percent and updates the price fame.

4. print_student():

The info of every student is revealed after this characteristic iterates thru the listing of college students.

5. delete():

To delete a student report and replace the student’s listing, this characteristic obtains the roll number.

// Function that adds the student's
// record in Examination Management
// Project
void add(struct student s[50])  {
printf("Enter the total ");
printf("number of working days \n");
scanf("%f", &tdays);
printf("Enter the number of students \n");
scanf("%d", &n);
    for (i = 0; i< n; i++) {
printf("Student number %d \n",(i + 1));
printf("Enter the name of  the student \n");
scanf("%s", s[i].name);
printf("Enter the roll number \n");
scanf(" %d", &s[i].rno);
printf("Enter the fees of the student 'P' for paid 'N' for not paid \n");
scanf(" %c", &s[i].fees);
printf("Enter the number of days the student was  present \n");
scanf("%f", &s[i].days);
        s[i].attend = (s[i].days / tdays)* 100;
printf("student attendance" " = %f \n",s[i].attend);
    }
execute();
}
// C program for the Examination
// Management System
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int option = 0;
int i = 0;
int n = 0;
int j = 0;
float present = 75.00;
char money = 'P';
float tdays = 1;
// Structure of Student
struct student {
    char name[20];
    int rno;
    char fees;
    float days;
    float attend;
} s[50];
// Functions
void add(struct student s[]);
void eligibleStudents(struct student s[]);
void execute();
void printStudents(struct student s[]);
void deleteRecord(struct student s[]);
// Function to execute the software
// for the student examination
// registration system
void execute()
{
printf(“ Enter the serial number  to select the option \n");
printf(" 1. To show Eligible candidates \n");
printf(" 2. To delete the student record \n");
printf(" 3. To change the eligibility criteria \n");
printf(" 4. Reset the eligibility criteria \n");
printf(" 5. Print the list of all the student \n");
printf(" Enter 0 to exit \n");
scanf("%d", &option);
// Switch Statement for choosing
    // the desired option for the user
    switch (option) {
    case 1:
eligibleStudents(s);
execute();
        break;
    case 2:
deleteRecord(s);
execute();
        break;
    case 3:
printf("Old Attendance required = %f",present);
printf( "\n Enter the updated attendence required \n");
scanf("%f", &present);
printf("fees status required  was %c \n",money);
printf("Enter the new fees "
               "status 'P' for paid 'N' "
               "for not paid and "
               "'B' for both \n");
scanf("%c", &money);
printf("Eligibility Criteria updated \n");
execute();
        break;
    case 4:
        present = 75.00;
        money = 'P';
printf("Eligibility creitria reset \n");
execute();
        break;
    case 5:
printStudents(s);
execute();
        break;
    case 6:
execute();
        break;
    case 0:
exit(0);
    default:
printf("Enter number only from 0-4 \n");
execute();
    }
}
// Function to print the students record
void printStudents(struct student s[])
{
    // Loop to iterate over the students
    // students records
    for (i = 0; i< n; i++) {
printf("Name of student %s \n",s[i].name);
printf("Student roll number = %d \n",s[i].rno);
printf("Student fees status = %c \n",s[i].fees);
printf("Student number of days present = %f \n",s[i].days);
printf("Student attendence = %f \n",
               s[i].attend);
    }  }
// Function to Student Record
void deleteRecord(struct student s[])  {
    int a = 0;
printf("Enter the roll number of the student to delete it ");
scanf("%d", &a);
    // Loop to iterate over the students
    // records to delete the Data
    for (i = 0; i<= n; i++) {
        // Condition to check the current
        // student roll number is same as
        // the user input roll number
        if (s[i].rno == (a)) {
// Update record at ith index
            // with (i + 1)th index
for (j = i; j < n; j++) {
strcpy(s[j].name, s[j + 1].name);
                s[j].rno = s[j + 1].rno;
                s[j].fees = s[j + 1].fees;
                s[j].days = s[j + 1].days;
                s[j].attend = s[j + 1].attend;
            }
printf("Student Record deleted");
        }
    }
}
// Function to print the student
// details of the eligible students
void eligibleStudents(struct student s[])
{
printf("____________________________________________________ \n");
printf("Qualified student are = \n");
// Iterate over the list
    // of the students records
    for (i = 0; i< n; i++) {
        // Check for the eligibility
        // of the student
        if (s[i].fees == money || 'B' == money) {
            if (s[i].attend>= present) {
printf("Student name = %s \n",s[i].name);
printf("Student roll no. = %d \n",s[i].rno);
printf(" Student fees = %c \n",s[i].fees);
printf(" Student attendence = %f \n",s[i].attend);
            }
        }
    }
}
// Function to add the students record
void add(struct student s[50])
{
printf("Enter the total ");
printf("number of working days \n");
scanf("%f", &tdays);
printf("Enter the number");
printf("of students \n");
scanf("%d", &n);
    for (i = 0; i< n; i++) {
printf("Student number %d \n",
               (i + 1));
printf("Enter the name ofthe student \n");
scanf("%s", s[i].name);
printf("Enter the roll number \n");
scanf(" %d", &s[i].rno);
printf("Enter the fees of thestudent 'P' for paid, 'N' for not paid \n");
scanf(" %c", &s[i].fees);
printf("Enter the number ofdays the student was present \n");
scanf("%f", &s[i].days);
        s[i].attend = (s[i].daystdays) * 100;
printf("student attendence = %f \n", s[i].attend);
    }
execute();
}
 // Driver Code
int main()
{
printf("Welcome to Student database registration \n");
printf("Enter 0 to exit \n");
printf("Enter 1 to add student record \n");
scanf("%d", &option);
    // Switch Statements
    switch (option) {
    case 0:
exit(0);
    case 1:
        add(s);
        break;
     default:
printf("Only enter 0 or 1");
execute();   }
    return 0;
}

Output:

Welcome to student database registration
Enter 0 to exit
Enter 1 to add student record
1
Enter the total number of working days
50
Enter the number of students
2
Student number 1
Enter the name of the student
Rudra
Enter the roll number
1
Enter the fees of the student ‘p’ for paid , ‘n’ for not paid
P
Enter the number of days the student was present
40
Student attendance = 80.000000
Student number 2
Enter the name of the student
Rudra1
Enter the roll number
2
Enter the fees of the student ‘p’ for paid , ‘n’ for not paid
n
Enter the number of days the student was present
45
Student attendance = 90.000000

Related Topics

GCD program of two numbers in C

GCD stands for Greatest Common Divisor, which is also known as Highest Common Factor, which can be abbreviated as HCF. Mathematically it can be defined as any two positive integers...

3 minutes read.

C Program to Find Largest Number Using Dynamic Memory Allocation

This tutorial will teach us how to locate the highest number a user has ever input into a dynamically allocated memory. C Program: #include <stdio.h> #include <stdlib.h> int main ()  {   int no;   double *data_n;   printf...

1 minute read.

Types of Array in C

What is an Array? One value can be stored in a variable at once. How many variables will you need if you have 100 values? Well, the answer isn't 100. It...

14 minutes read.

Type Conversion in the C

The process of changing one data type to another in the C programming language is known as "type conversion." The type conversion method is only executed on data types that...

4 minutes read.

Ftell() Function in C

Ftell(): In File Handling we have some special functions like Ftell(), Fseek(), rewind() etc.. while you are randomly accessing the file these functions play very important role and these functions...

3 minutes read.

#undef in C

#undef in C In the C programming language, the #undef directive is used to undefine the macro or any constant, which will be defined by the preprocessor directive #define. The #undef...

3 minutes read.

Compilation Process in C language

What is the Compilation Process?  The compilation is a method whereby the source code is converted into object code. It is achieved with compiler assistance. The compiler tests the source code for syntactic...

3 minutes read.

Double Specifier in C

What is a double specifier? The term double denotes the double data type in C. It more accurately depicts floating point numbers. The idea that it has twice the precision of...

3 minutes read.

File Handling in C

File Handling is used to open, read, write, search and close file.  C files I/O functions handles data on secondary storage device. File handling function: There are varioushandling functions in C. Function Operation fopen() It is...

4 minutes read.

Write() function in c

As the name suggests the write () function is used to write the file descriptor. In other words it is used to write any file name without specifying file name,...

3 minutes read.

If Statement in C

Decision Control Statements We frequently desire one set of instructions to be carried out in one circumstance while another set of instructions to be carried out in a completely different circumstance....

3 minutes read.

Exit control loop in C

To examine the termination condition for an exit, we usually use an exit control loop in C. If the evaluation for termination condition results in true, then the control would...

3 minutes read.

Find out Power without using POW function in C

Introduction: In this discussion, we will discuss how we find out power without using the POW function in C. In this article, you'll understand how to compute integer powers in...

3 minutes read.

Call Back Function in Embedded C

Callback function are one the most remarkable systems in C. A callback function is any code that is passed as a contention to another code, so this is the last...

3 minutes read.

C and C++ Binary Files

What is a binary file? A file in which the content is written in binary format is called a binary file. A binary file is not a text file. There are...

7 minutes read.

Caesar Cipher Program in C

What is Caesar Cipher? The Caesar Cipher is a type of substitution cipher that is named after Julius Caesar, who is said to have used it to encrypt messages sent to...

2 minutes read.

C Decision control statement

Decision Making C conditional statements are used to specify one or more conditions. The statements will be executed if the condition becomes true otherwise alternative statement will be executed if the...

3 minutes read.

Recursion in C

Recursion in C: In the C programming language, the concept known as recursion exists that is a technique in which a function calls itself either directly or indirectly. It allows...

4 minutes read.

Break, continue and goto statement in C

Break statement Break statement is used to break the process of a loop (while, do while and for) and switch case. Syntax: break; Example 1 while(test Expression) { // codes if(condition for break){ break; } // codes } Example 2 For(int it, condition,...

1 minute read.

Runtime vs compile time in C

In the C programming language, the often used terms in every step consist of compile time and runtime. The compile time is referred to the source code that will be...

4 minutes read.