Visual C++ Program for the Implementation of Course Counselling System | IT1253 - Software Engineering Laboratory


ABSTRACT:
This project on “Course counseling system” was developed for the students. The courses are offered to the students based on their cut off marks.
create a leave on intent is to record. The respective courses to the students. We use 3 functions each independent from each other.
This will get the input from the user & the respective courses are offered to the students.               

REQUIREMENT ANALYSIS:

SOFTWARE REQUIREMENTS:
    Front End   :    ‘C++’ language.
    Back End   :     File Management System (using Dat files)
    Operating system:    Any Operating System (Window or Linux)

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 Course Counseling system in Theatre involves the following function or process
Course Counseling consists of four modules. They are
    Module 1: Insert Module
    Module 2: Delete Module
    Module 3: Display Module
    Module 4: Exit
Insert Module:
In this module the user enters the detail of the student.
Delete Module:
    In this module the user deletes the student details.
Display Module:
    In this module the student details are displayed.
Exit:
    In this module the user can quit from the project.

NON FUNCTIONAL REQUIREMENTS:
    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>
#include<string.h>
#define TEST_LEN 50
int main()
{
    int c;
    char ch='y';
    SQLINTEGER Regno,Mark,Cutoff;
    SQLCHAR Name[TEST_LEN+1],Courseoffered[TEST_LEN+1];
    HENV hEnv=NULL;
    HDBC hDBC=NULL;
    HSTMT hStmt=NULL;
    UCHAR szSqlStr[]="insert into course(Regno,Name,Mark,Cutoff,Courseoffered) values(?,?,?,?,?)";
    UCHAR szSqlStr1[]="delete * from course where Regno = ?";
    UCHAR szSqlStr2[]="select * from course";
    UCHAR szDSN[SQL_MAX_DSN_LENGTH]="counsel";
    UCHAR *szUID=NULL;
    UCHAR *szPasswd=NULL;
    UCHAR szModel1[128];
    UCHAR szModel2[128];
    UCHAR szModel3[128];
    UCHAR szModel4[128];
    UCHAR szModel5[128];
    SDWORD cbModel1;
    SDWORD cbModel2;
    SDWORD cbModel3;
    SDWORD cbModel4;
    SDWORD cbModel5;
    SDWORD cbtest=SQL_NTS;
    RETCODE retcode;
   do
   {
    printf("\n=======================================");\n
    printf("COURSE COUNSELLING SYSTEM");
    printf("\n=======================================\n");
    printf("1.Enter the detail \n2.Delete the detail\n3.Display the detail\n\n");
    printf("Enter ur option......\n");
    scanf("%d",&c);
    switch(c)
    {
    case 1:
        printf("\n-----------------------------------------");
        printf("\nEnter the details");
        printf("\n-----------------------------------------");
        printf("\nEnter the Reg No:\t");
        scanf("%d",&Regno);
        printf("\nEnter the Name:\t");
        scanf("%s",&Name);
        printf("\nEnter the Mark:\t");
        scanf("%d",&Mark);
        printf("\nEnter the Cutoff:\t");
        scanf("%d",&Cutoff);
        printf("\nEnter the Courseoffered:\t");
        scanf("%s",&Courseoffered);   
        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,Name,0,&cbtest);
SQLBindParameter(hStmt,3,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Mark,0,&Mark);
SQLBindParameter(hStmt,4,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&Cutoff,0,&Cutoff);   
SQLBindParameter(hStmt,5,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,TEST_LEN,0,Courseoffered,0,&cbtest);
             retcode=SQLExecute(hStmt);
            printf("\n\n Detail is inserted.......... \n\n");
        }
        break;
    case 2:
        printf("\nDelete the 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("\nEnter the Reg No\n");
            scanf("%d",&Regno);
            retcode=SQLExecute(hStmt);
            printf("detail has been deleted\n\n");
        }
        break;
    case 3:
        printf("\nDisplay the 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,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);
            retcode=SQLFetch(hStmt);
            printf("\n\tReg No\tName\tMark\tCutoff\tCourseoffered\n\n");
            while(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
            {
               printf("\t%s\t%s\t%s\t%s\t%s\n",szModel1,szModel2,szModel3,szModel4,szModel5);
               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 "COURSE COUNSELING 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.