×

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

If else Programs in C Programming

If else Programs in C programming The if-else statement in C is based on some particular conditions to perform the operations. If and only if the given condition is valid, the operations listed in...

4 minutes read.

Difference between Pre-increment and Post-increment in C

Increment operators are the kind of operators that are used to increment the cost of the operand by way of 1. In different words, the increment operator is an operator...

4 minutes read.

Nested if-else statement in C

If we use an if-else statement within another if statement in a C program, it is called a nested if-else statement in C. It helps to check the condition inside...

3 minutes read.

C Programming Tutorial

What is C Programming C is most popular and widely used computer programming language. It was developed by Dennis Ritchie in 1972 at the Bell Lab. It is used to develop system application software. There...

8 minutes read.

C/C++ Program to Find the Size of int, float, double and char

In this tutorial, we will learn how to use the sizeof operator to determine the size of each variable. Program to Determine Variable Size Write a C or C++ program to determine the...

2 minutes read.

2f in C language

Float data type in c: Double-precision floating-point numbers with up to 17 significant digits are stored in the FLOAT data type. FLOAT is equivalent to C's double data type and IEEE...

3 minutes read.

Difference between Array and List in C

C# Array vs List is where the abstraction and implementation of human computing meet.  Arrays are incredibly related to the hardware concept of contiguous and contiguous memory, where each part is...

3 minutes read.

Displaying Array in C

Reference a collection of variables of similar data type in an array using a single element. The parts are stored next to each other. When declaring an array, you must specify...

4 minutes read.

Compound Interest Program in C

Interest on loans and deposits is compound interest. This is the most commonly used concept in everyday life. Compound interest on an amount is based on principal and interest earned...

3 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.

Flexible Array Members in a Structure in C

There is flexibility to declare array from c99 generation onwards that declaration of the collections can be made possible without even mentioning its dimension, which means that the displays are...

4 minutes read.

Library Functions in C

What are library functions? Library functions are the built-in functions (functions provided by the system) which are stored in the library. The library is the common location where these functions are...

3 minutes read.

Purpose of a Function Prototype in C

A function prototype in C is a declaration of a function that specifies the function's name, return type and parameters. It has the following syntax: return_type function_name(parameter_list); For example, the prototype for...

4 minutes read.

Nested Loops in C Programming Examples

A nested loop is generally used when we want to run a loop statement inside another loop statement. This kind of loop is also known as a “loop inside the...

6 minutes read.

Distance Vector Routing Protocol Program in c

A distance-vector routing protocol is one of the foremost instructions of routing protocols in pc conversation principle for packet-switched networks. The hyperlink-nation protocol is the alternative foremost class.The Bellman-Ford set...

4 minutes read.

Variable Declaration in C

What is a Variable? A Variable is nothing more than a name for a memory place where data/information can be stored. Any alphabet (from a to z or A to Z), the...

4 minutes read.

Armstrong Number in C

The Armstrong number is defined as the sum of each of its digits to the power of the number base for the each given number with any given number base....

3 minutes read.

Garbage in C

Garbage in C The C programming language is a perfect fit for embedded systems as it provides low level control, structured programming, and portability. On the contrary, it does not provide...

3 minutes read.

Volatile in C

Introduction A volatile keyword is a qualifier in C. Qualifiers are nothing but keywords which are used to modify the properties of a variable. Qualifiers are of two types: 1) Const The const type...

3 minutes read.

While Loop Syntax in C

What is Loop? The statements in the sequence are repeatedly executed via looping statements in C until the condition is met. The body of a loop and a control statement make...

4 minutes read.