Signup/Sign In

Simple Result System Project Using C Language

Introduction

Simple Result System is a little project written in the C programming language. You can keep track of the pupils' grades and update them at any time. Students might be given marks based on their performance in each subject. The project is straightforward and straightforward to use. The system is written entirely in the C programming language.

You will be greeted with a "Welcome Screen" when you build and execute the project. Following that, many choices will appear on your computer screen. Select the required project modification function from the drop-down menu. The admin is in charge of the majority of the system. He has the ability to add and remove teachers. He can also add students. Following the addition of instructors, the administrator may finally assign grades to the pupils. All of the data has been preserved.

Source Code for Simple Result System Project Using C Language

#include<iostream>
#include<fstream>
#include<stdio.h>
#include "admin.h"
#include "teacher.h"
#include "student.h"

using namespace std;

admin ad;

int main()
{
  fstream fs, f;

  cout<<"\n\nWelcome to Kendriya Vidyalaya Results";
  int opt=0, subopt=0, id, found=0;

  student St;

  while(opt!=4)
  {
    cout<<"\n\nMenu:\n1. Admin\n2. Teacher: Update Marks\n3. Student: Check Results\n4. Exit\n\nEnter option: ";
    cin>>opt;

    switch(opt)
    {
      case 1: cout<<"\n\nSub Menu:\n1. Add teacher\n2. Add student\n\nEnter option: ";
              cin>>subopt;
              switch(subopt)
              {
                case 1: ad.addteacher();
                        break;
                case 2: ad.addstudent();
                        break;
                default: cout<<"\n\nInvalid choice";
                         break;
              }
              break;

      case 2: cout<<"\n\nEnter teacher id: ";
              cin>>id;

              f.open("teacher.dat", ios::in);
              teacher T;  found = 0;

              while(!f.eof()&&found==0)
              {
                f.read((char*)&T, sizeof(T));

                if(T.idcompare(id))
                { T.updateMarks();
                  found=1;
                }
              }

              if(found == 0)
                cout<<"\n\nInvalid ID";

              f.close();
              break;

      case 3: cout<<"\n\nEnter student roll no: ";
              cin>>id;

              fs.open("student.dat", ios::in);
              found = 0;

              while(!fs.eof()&&found==0)
              {
                fs.read((char*)&St, sizeof(St));

                if(id == St.getroll())
                { St.display();
                  found=1;
                }
              }

              if(found == 0)
                cout<<"\n\nInvalid roll number";

              fs.close();
              break;

      case 4: return 0;

      default: cout<<"\n\nInvalid choice";
               break;
    }

  }

 return 0;
 }

Output

Simple Result

Final Words

Because this is a small project, you won't be able to see the students' grades. Also, after you've input the prior data, you can't change the student grades.



About the author:
Adarsh Kumar Singh is a technology writer with a passion for coding and programming. With years of experience in the technical field, he has established a reputation as a knowledgeable and insightful writer on a range of technical topics.