Visual C++ Program for the Implementation of Financial Accounting System | IT1253 - Software Engineering Laboratory

ABSTRACT:
   This project “Financial Accounting System” was developed mainly for finance maintanence. It is an automated tool which is used to maintain the finance.
    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 financial accounting activity involves the following function or process
Financial accounting system consists of four modules. They are
    Module 1: Loans available
    Module 2: Entry Module
    Module 3: Display Module
    Module 4: Exit
Loans available :
  This module showing the type of loans.
Entry Module :
     In this module the user enters 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 "stdafx.h"
#include<windows.h>
#include<sqlext.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#define maxamount 50000
int main()
{
    int c;
    char ch='y';
    SQLCHAR accname[50],accaddr[50],loan[50];
    SQLINTEGER amount;
    HENV hEnv=NULL;
    HDBC hDBC=NULL;
    HSTMT hStmt=NULL;
    UCHAR szSqlStr[]="select * from fin_loans";
    UCHAR szSqlStr1[]="insert into fin_cust(accname,accaddr,loan,amount)values(?,?,?,?)";
    UCHAR szSqlStr2[]="select * from fin_cust where accname=?";
    UCHAR szDSN[SQL_MAX_DSN_LENGTH]="financial";
    UCHAR *szUID=NULL;
    UCHAR *szpasswd=NULL;
    UCHAR szModel1[128],szModel2[128],szModel3[128],szModel4[128];
    SDWORD cbModel1,cbModel2,cbModel3,cbModel4;
    SDWORD cbtest=SQL_NTS;
    RETCODE retcode;
    do
    {
     printf("\n1.Loans Available\n2.Entry Module\n3.Display Module\n4.Exit\n");
     printf("Enter your option : ");
     scanf("%d",&c);
     switch(c)
     {
     case 1:
         printf("\n\tLoans Available\n");
         SQLAllocEnv(&hEnv);
         SQLAllocConnect(hEnv,&hDBC);
         retcode=SQLConnect(hDBC,szDSN,SQL_NTS,szUID,SQL_NTS,szpasswd,SQL_NTS);
          retcode=SQLAllocStmt(hDBC,&hStmt);
          retcode=SQLPrepare(hStmt,szSqlStr,sizeof(szSqlStr));
          retcode=SQLExecute(hStmt);
          SQLBindCol(hStmt,1,SQL_C_CHAR,szModel1,sizeof(szModel1),&cbModel1);
          SQLBindCol(hStmt,2,SQL_C_CHAR,szModel2,sizeof(szModel2),&cbModel2);
          //printf("%s",szModel1);
          retcode=SQLFetch(hStmt);
          while(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
          {
           printf("\n\t%s\t%s\n",szModel1,szModel2);
           retcode=SQLFetch(hStmt) ;
          }
         break;
     case 2:
         printf("\n\tEntry Module\n");
         printf("Enter the Account Holder's Name : ");
         scanf("%s",&accname);
         printf("Enter the Account Holder's Address : ");
         scanf("%s",&accaddr);
         printf("Enter the type of the loan{Business,Education,Home,Personal or Other} ");
         scanf("%s",&loan);
         printf("Enter the Amount : ");
         scanf("%d",&amount);
         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_CHAR,SQL_CHAR,50,0,accname,0,&cbtest);
 SQLBindParameter(hStmt,2,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,50,0,accaddr,0,&cbtest);
 SQLBindParameter(hStmt,3,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,20,0,loan,0,&cbtest);
 SQLBindParameter(hStmt,4,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,1,0,&amount,0,&amount);
          retcode=SQLExecute(hStmt);
          printf("\nYour Details Saved\n");
          printf("Application Accepted\n");
         }
        else   
          printf("Application Rejected\n");
        break;
     case 3:
         printf("\n\tDisplay Module\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));
          printf("Enter the Account Holder's Name : ");
          scanf("%s",&accname);

 SQLBindParameter(hStmt,1,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,50,0,accname,0,&cbtest);
          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);
          retcode=SQLFetch(hStmt);
          while(retcode==SQL_SUCCESS||retcode==SQL_SUCCESS_WITH_INFO)
          {
           printf("\n\t%s\t%s\t%s\t%s\n",szModel1,szModel2,szModel3,szModel4);
           retcode=SQLFetch(hStmt);
          }
         }
         break;
     case 4:
         exit(0);
         break;
     default:
         printf("\nEnter the correct option\n");
         main();
     }
     flushall();
     printf("Do you want to continue(y/n) : ");
     scanf("%c",&ch);
    }while(ch=='y');
    return 0;
    getch();
    }

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
     // TODO: Place code here.
    return 0;
}

OUTPUT:

 LOANS AVAILABLE:

 ENTRY MODULE:

DISPLAY MODULE:

CONCLUSION:
             The  project we have done here is “FINANCIAL ACCOUNTING SYSTEM” using Visual 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 »

If you still didn't find what you're looking for, you can search this website below: