Visual C++ Program for the Implementation of School Administrative System | IT1253 - Software Engineering Laboratory


ABSTRACT:
    This project “School Administrative System” was developed mainly for School maintanence. It is an automated tool which is used to maintain the School.
    It is an analytical framework designed to produce statistical series that are both consistent and compatible.
    It gives a clear explanation of what is included in each revenue source and each expenditure function.

REQUIREMENT ANALYSIS:

SOFTWARE REQUIREMENTS:
    Front End           :     Visual C++ language.
    Back End           :     MS Access
    Operating system     :     Windows  XP


HARDWARE REQUIREMENTS:
    Processor     :       3.06 GHZ operating speed.
    Hard Disk    :       80GB Capacity.
    RAM           :       256MB
    Monitor       :       CRT 17’
    Mouse         :       OPTICAL
    Keyboard    :       Alphanumeric keys.
     The specified hardware requirements are the minimum requirements that are needed to implement in the project.

FUNCTIONAL REQUIREMENTS:
    As mentioned in the requirements, the School administrative system involves the following function or process
School administrative system consists of four modules. They are
    Module 1: Entry available
    Module 2: Delete Module
    Module 3: Display Module
    Module 4: Exit
  Entry available:
    In this module the user enters the detail of the customer.
  Delete Module:
    In this module the user deletes the detail of the customer.
  Display Module:
   This module display the detail of the customer.
  Exit:
   In this module the user can quit from the project.

NON FUNCTIONAL REQUIREMENT:
    It is reliable software. Whenever the user wants to retrieve any information from the database, it returns with the correct information. Provided, the information stored is a correct one. The cost of maintenance of the software is very low. The size of the software is less. This means, it is a portable one. If any request is given, the time taken for the response is low. This makes the software more efficient.

SOURCE CODE:
#include<windows.h>                 
#include<sqlext.h>
#include<stdio.h>
#define TEST_LEN 50

int main()
{
    int c;
    char ch='y';
    SQLINTEGER  Regno,staffno;
    SQLCHAR Studentname[TEST_LEN], address[TEST_LEN], clas[TEST_LEN], feesdue[TEST_LEN], section[TEST_LEN], staffname[TEST_LEN], subject[TEST_LEN];
    HENV hEnv=NULL;
    HDBC hDBC=NULL;
    HSTMT hStmt=NULL;
    UCHAR szSqlStr[]="insert into sch(Regno, Studentname, address, clas, section, feesdue, staffno, staffname, subject) values(?,?,?,?,?,?,?,?,?)";
    UCHAR szSqlStr1[]="delete * from sch where Regno = ?";
    UCHAR szSqlStr2[]="select * from sch";
    UCHAR szDSN[SQL_MAX_DSN_LENGTH]="school";
    UCHAR *szUID=NULL;
    UCHAR *szPasswd=NULL;
    UCHAR szModel1[128], szModel2[128], szModel3[128], szModel4[128], szModel5[128], szModel6[128], szModel7[128], szModel8[128], szModel9[128];
SDWORD cbModel1, cbModel1, cbModel1, cbModel1, cbModel1, cbModel1, cbModel1, cbModel1, cbModel1;
SDWORD cbtest=SQL_NTS;
RETCODE retcode;
do
{
    printf("=======================================);
    printf("\n     SCHOOL ADMINISTRATIVE SYSTEM");
    printf("\n=======================================\n");
    printf("1.Enter the Student details \n2.Delete the Student detail\n3.Display the Student detail\n");
    printf("entr ur option......\n");
    scanf("%d",&c);
    switch(c) 
   {
    case 1:
        printf("\n-----------------------------------------");
        printf("\nEnter the details");
        printf("\n-----------------------------------------");
        printf("\nEnter the Regno:\t");
        scanf("%d",&Regno);
        printf("\nEnter the name:\t");
        scanf("%s",&Studentname);
        printf("\nEnter the Address:\t");
        scanf("%s",&address);
        printf("\nEnter the class:\t");
        scanf("%s",&clas);
        printf("\nEnter the section:\t");
        scanf("%s",&section);
        printf("\nfeesdue(y/n):\t");
        scanf("%s",&feesdue);
        printf("\nEnter the Staffno:\t");
        scanf("%d",&staffno);
        printf("\nEnter the Staff name:\t");
        scanf("%s",&staffname);
        printf("\nEnter the Subject name:\t");
        scanf("%s",&subject);
        printf("\n-----------------------------------------");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr,sizeof(szSqlStr));
 SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Regno,0,&Regno);
 SQLBindParameter(hStmt,2,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,Studentname,0,&cbtest);
 SQLBindParameter(hStmt,3,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,address,0,&cbtest);
 SQLBindParameter(hStmt,4,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,clas,0,&cbtest);
 SQLBindParameter(hStmt,5,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,section,0,&cbtest);
 SQLBindParameter(hStmt,6,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,feesdue,0,&cbtest);
 SQLBindParameter(hStmt,7,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&staffno,0,&staffno);
 SQLBindParameter(hStmt,8,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,staffname,0,&cbtest);
 SQLBindParameter(hStmt,9,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,subject,0,&cbtest);
            retcode=SQLExecute(hStmt);
            printf("\n\n Detail is inserted..........");
        }
        break;
    case 2:
        printf("\nDelete the student detail\n");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr1,sizeof(szSqlStr1));
 SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Regno,0,&Regno);      
            printf("enter the Regno\n");
            scanf("%d",&Regno);
            retcode=SQLExecute(hStmt);
            printf("\nDetail has been deleted\n\n");
        }
        break;
    case 3:
        printf("\nDisplay the SCHOOL ADMINISTRATIVE SYSTEM\n\n");
        SQLAllocEnv(&hEnv);
        SQLAllocConnect(hEnv,&hDBC);
        retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szPasswd,SQL_NTS);
        if(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
        {
            retcode=SQLAllocStmt(hDBC,&hStmt);
            retcode=SQLPrepare(hStmt,szSqlStr2,sizeof(szSqlStr2));
            retcode=SQLExecute(hStmt);
            SQLBindCol(hStmt,1,SQL_C_CHAR,szModel1,sizeof(szModel1),&cbModel1);
            SQLBindCol(hStmt,2,SQL_C_CHAR,szModel2,sizeof(szModel2),&cbModel2);
            SQLBindCol(hStmt,3,SQL_C_CHAR,szModel3,sizeof(szModel3),&cbModel3);
            SQLBindCol(hStmt,4,SQL_C_CHAR,szModel4,sizeof(szModel4),&cbModel4);
            SQLBindCol(hStmt,5,SQL_C_CHAR,szModel5,sizeof(szModel5),&cbModel5);
            SQLBindCol(hStmt,6,SQL_C_CHAR,szModel6,sizeof(szModel6),&cbModel6);
            SQLBindCol(hStmt,7,SQL_C_CHAR,szModel7,sizeof(szModel7),&cbModel7);
            SQLBindCol(hStmt,8,SQL_C_CHAR,szModel8,sizeof(szModel8),&cbModel8);
            SQLBindCol(hStmt,9,SQL_C_CHAR,szModel9,sizeof(szModel9),&cbModel9);
            retcode=SQLFetch(hStmt);
            printf("Regno\tStudentname\tAddress\t\tClass\tsection\tFeesdue\tStaffNo\tStaffName\tSubject\n\n");
            while(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
            {
                printf("%s\t%s\t\t%s\t%s\t%s\t%s\t%s\t%s\t\t%s\n", szModel1, szModel2, szModel3, szModel4, szModel5, szModel6, szModel7, szModel8, szModel9);
                retcode=SQLFetch(hStmt);
            }
        }
        break;
    }
   flushall();
   printf("\nDo u wan to cont (y/n)");
   scanf("%s",&ch);
 }
 while(ch=='y');
 return 0;
}

OUTPUT:

INSERTION:
DISPLAY:
DELETION:
DISPLAY:

CONCLUSION:
             The  project we have done here is “SCHOOL ADMINISTRATIVE SYSTEM” using C language.
In this project we have designed a software to implement the customer details that any user can perform
it in a simple and a better way. This way of format helps us to have clear database.
Previous
Next Post »

Still not found what you are looking for? Try again here.