Visual C++ Program for the Implementation of Text Editor | IT1253 - Software Engineering Laboratory

ABSTRACT:
 This project implements the process of text editor. It’s an application that which creates a file, edits it and store4s it in a particular location. It is very much essential to be aware of all records. Now in this application C language is used for editing process. The objectives of the proposed system are to create a new file, edit it & save it in corresponding location. The input to the application is the name of the file, input to the file, etc,. The output is the editing of the file under specific conditions.

REQUIREMENTS ANALYSIS:
      It results in the specification of software’s operational characteristics, indicates software’s interface with other system elements and establishes constraints that software must meet. The aim of analysis is to understand the problem with a view to eliminate any deficiencies in the requirement specification such as incompleteness, Inconsistencies, etc. The model which we
are trying to build may be or may not be ready.

OVERALL OBJECTIVES AND PHILOSOPHY:
USER REQUIREMENT:
•    What should be initially done
•    In what language should that be given
•    Where to store the file

•    How to store the file

DEVELOPER REQUIREMENT:
•    Where does the file exist
•    Is there any records in the file
•    What items to be edited
•    Software and hardware requirements as mentioned above.

SOFTWARE REQUIREMENT SYSTEM (SRS):
FUNCTIONAL REQUIREMENTS:
The functional requirements of a system mainly comprises of the following strategies:
•    Files to be edited
•    Various stages of edition
•    Details about the location of the file
The software requirements of the application are:
•    FRONTEND: VC++
•    BACKEND: MSACCESS
•    DRIVER: ODBC
The hardware requirements of the application are:
•    INTEL PENTIUM 3
•    MINIMUM 128 RAM
Goal of implementation:
The primary goal of this application is to maintain a perfect record of the auctioneers who have auctioned the properties at different places. This is achieved by the above mentioned requirements.

DESIGN:
Software design deals with transforming the customer requirements, as described in the SRS document, into a form (a set of documents) that is suitable for implementation in a programming language. A good software design is seldom arrived by using a single step procedure but rather through several iterations through a series of steps. Design activities can be broadly classified into two important parts:

•    Preliminary (or high-level) design and
•    Detailed design.

     The aim of design is to produce a model that will provide a seamless transition to the coding phase, i.e. once the requirements are analyzed and found to be satisfactory, a design model is created which can be easily implemented.

Characteristics of a good software design

The characteristics are listed below:

•    Correctness: This application has got a perfect design that which correctly implement all the functionalities identified in the SRS document.
•    Understandability: our application is easily understandable.

•    Efficiency: our application is highly efficient.

•    Maintainability: It is easily amenable to change.

Data Flow Diagram (Level 0):


 Component Description:


 Entity Relationship Diagram:



Component Description:


TESTING:
Testing a program consists of providing the program with a set of test inputs (or test cases) and observing if the program behaves as expected. If the program fails to behave as expected, then the conditions under which failure occurs are noted for later debugging and correction.

Unit testing:

Unit testing is undertaken after a module has been coded and successfully reviewed. Unit testing (or module testing) is the testing of different units (or modules) of a system in isolation.
In order to test a single module, a complete environment is needed to provide all that is necessary for execution of the module. That is, besides the module under test itself, the following steps are needed in order to be able to test the module:

• The procedures belonging to other modules that the module under test calls.

• Non local data structures that the module accesses.

 • A procedure to call the functions of the module under test with appropriate parameters

System testing:

System tests are designed to validate a fully developed system to assure that it meets its requirements.
There are essentially three main kinds of system testing:
• Alpha Testing. Alpha testing refers to the system testing carried out by the test   team within the developing organization.
• Beta testing. Beta testing is the system testing performed by a select group of friendly customers.
• Acceptance Testing. Acceptance testing is the system testing performed by the customer to determine whether he should accept the delivery of the system.

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
void newfile()
{
    FILE *fp;
    char name[10];
    int i=0;
    char count[100];
    strcpy(count,"");
    printf("\n\n\t\t\t\t New File ");
    printf("\n__________________________________________________________");
    printf("\n\n Enter the name of the file to create\t:");
    scanf("%s",name);
    fp=fopen(name,"w");
    printf("\n Enter the contents of the file and terminated with @ \n\n");
    while(i<100)
    {
        scanf("%c",&count[i]);
        if(count[i]!='@')
        {
            fputc(count[i],fp);
        }
        else
        {
            fclose(fp);
            break;
        }
        i++;
    }
}
void openfile()
{
    FILE *fp;
    char name[10];
    char c;
    printf("\n\n\t\t\t\t Open File ");
    printf("\n___________________________________________________");
    printf("\n\n Enter the name of the file\t:");
    scanf("%s",name);
    printf("\n------------------------------------------------------\n\n");
    fp=fopen(name,"r");
    while((c=fgetc(fp))!=EOF)
    {
        printf("%c",c);
    }
    fclose(fp);
    printf("\n\n------------------------------------------------");
}
void editfile()
{
    FILE *fp;
    int i,j,k,m;
    char name[10];
    char count[100];
    char c;
    char c2[50],c3[50];
    int len;
    i=0;
    printf("\n\n Enter the name of the file\t:");
    scanf("%s",name);
    printf("--------------------------------------------------------\n\n");
    fp=fopen(name,"r");
    strcpy(count,"");
    while((c=fgetc(fp))!=EOF)
    {
        count[i]=c;
        i++;
    }
    fclose(fp);
    count[i]='\0';
    printf("%s",count);
    len=i;
    printf("\n\n------------------------------------------------------\n");
    printf("\n\n\t\t\t\tEDITING SECTION \n");
    printf("\n========================================================\n");
    j=0;
    fp=fopen(name,"w");
    for(i=0;i<len;i++)
    {
        if(count[i]=='\n'&&i!=0)
        {
            c2[j]='\0';
            j=0;
            printf("%s",c2);
            printf("\n Do you want to EDIT [Y(1)/N(0)]\t\t:");
            scanf("%d",&k);
            if(k==1)
            {
                printf("\nEnter the modification terminated by @\n");
                m=0;
                strcpy(c3,"");
                while(m<30)
                {
                    scanf("%c",&c3[m]);
                    if(c3[m]=='@')
                    {
                        c3[m]='\0';
                        break;
                    }
                    else if(c3[m]!='\n')
                    {
                        m++;
                    }
                }
                fputs(c3,fp);
                fputc('\n',fp);
            }
            else
            {
                fputs(c2,fp);
                fputc('\n',fp);
            }
        }
        else
        {
            c2[j]=count[i];
            j++;
        }
    }
    fclose(fp);
}
void main()
{
int choice,op;
A:
    printf("\n\t\t\t\tEDITOR ");
    printf("\n__________________________________________________________");
    printf("\n 1.New File\t\t2.Open File\t\t3.Edit File\t4.Exit EDITOR");
    printf("\n__________________________________________________________");
    printf("\n\n Enter your choice\t:");
    scanf("%d",&choice);
    switch(choice)
    {
    case 1:
        newfile();
        break;
    case 2:
        openfile();
        break;
    case 3:
        editfile();
        break;
    case 4:
        exit(0);
        break;
    }
    goto A;
}

OUTPUT:

NEW FILE CREATION:

OPEN CREATED FILE:

EDIT EXISTING FILE:

OPEN EDITED FILE AND EXIT:


CONCLUSION:
        Thus our application- text editor is successfully automated with the mentioned software and hardware requirements. The records that are entered in are automatically updated. The above mentioned testing techniques are also performed and our application is finally deployed to our customers. This automated system has the advantage of maintaining the records properly without any manual stress. Hence it becomes easier for the user to automate the files edited. The maintenance of our system wholly depends on the customer’s risk.
Previous
Next Post »

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