Professional Documents
Culture Documents
Dsu Final Micro Project 1
Dsu Final Micro Project 1
BHARATI VIDYAPEETH’S
MICRO-PROJECT REPORT
(22317)
Group Number: 9
Maharashtra State
Board of Technical Education, Mumbai
Year 2022-23
CERTIFICATE
This is to certify that of 1. Mr. Manish Mahendra Patil
Date: _____________________
Seal of institute
Title of Micro-Project:
Text Editor Using Stack
1.0. Brief Introduction
Text editors can be somewhat simple or rather complex depending on the design and
implementation. It's important to consider your target audience (users) and what
functionalities that you want your text editor to have. Perhaps you want a specialized text
editor rather than a general purpose one as this will make a significant impact on designing
and implementing a text editor. Take for instance you want a text editor to handle small files
and fixed lengths of lines. Perhaps you want a text editor that minimizes memory usage
while still performs adequately enough .
2) FLOWCHART:
Methodology to be followed:
1. Preparation of Part A
2. Information Collection
3. Information Analysis
4. Design of Project(Algorithm)
5. Implementation
6. Report Preparation
7. PPT preparation
1 Hardware:Computer Computer(i3_i5 1 -
Learning Resources
Sr. No. Title of Book Author Publication
01 Data structure using c Reema Thareja Oxford University Press
We start our code by including the header files “stdio.h” and “conio.h”. The code also has a
array to hold the values and the variable top for manipulation
The part of the document to edited or modifies is selected. determining how to format this
lines on view and how to display it.
Specify and execute the operations that modify the document.
Update the view properly.
The above steps include filtering, formatting, and traveling.
User Interface of editors: The user interface of editors typically means the input, output
and the interaction language. The input devices are used to enter text, data into a
document or to process commands. The output devices are used to display the edited
form of the document and the results of the operation/commands executed. The
interaction language provides the interaction with the editor.
Input Devices : Input devices are generally divided as text input, button devices and
locator devices. Text device is a keyboard. Button devices are special function keys. The
locator devices include the mouse. There are special voice devices as well which writes
into text whatever you speak.
Text editors can be somewhat simple or rather complex depending on the design and
implementation. It's important to consider your target audience (users) and what
functionalities that you want your text editor to have. Perhaps you want a specialized text
editor rather than a general purpose one as this will make a significant impact on designing
and implementing a text editor. Take for instance you want a text editor to handle small files
and fixed lengths of lines. Perhaps you want a text editor that minimizes memory usage
while still performs adequately enough.
The bare backbones of a text editor heavily relies on the data structures you decide to use
for your operations. There are always tradeoffs when it comes to data structures as you have
to consider the difficulty of implementation for the performance and memory tradeoffs. It
primarily based on what you want your text editor to be able to do.
Vert important :
There is no clear-cut solution as text editors will all vary in what data structures are used.
Text editors in the past or that are currently being used have used these data structures
listed down below.
Data Structures:
There are important differences between plain text (created and edited by text editors)
and rich text (such as that created by word processors or desktop publishing software).
Rich text, on the other hand, may contain metadata, character formatting data
(e.g. typeface, size, weight and style), paragraph formatting data (e.g. indentation,
alignment, letter and word distribution, and space between lines or other paragraphs), and
page specification data (e.g. size, margin and reading direction). Rich text can be very
complex. Rich text can be saved in binary format (e.g. DOC), text files adhering to a markup
language (e.g. RTF or HTML), or in a hybrid form of both (e.g. Office Open XML).
Text editors are intended to open and save text files containing either plain text or anything
that can be interpreted as plain text, including the markup for rich text or the markup for
something else (e.g. SVG).
3) FLOWCHART:
1 Hardware: Computer(i3_i5 1 -
1) Learning Resources
Sr. No. Title of Book Author Publication
7.0. Outputs
1) Program:
#include<stdio.h>
#include<conio.h>
#include<process.h>
int i,j,ec,fg,ec2;
char fn[20],e,c;
FILE *fp1,*fp2,*fp;
void Create();
void Append();
void Delete();
void Display();
void main()
{
do {
clrscr();
printf("\n\t\t***** TEXT EDITOR *****");
printf("\n\n\tMENU:\n\t-----\n ");
printf("\n\t1.CREATE\n\t2.DISPLAY\n\t3.APPEND\n\t4.DELETE\n\t5.EXIT\n");
printf("\n\tEnter your choice: ");
scanf("%d",&ec);
switch(ec)
{
case 1:
Create();
break;
case 2:
Display();
break;
case 3:
Append();
break;
case 4:
Delete();
break;
case 5:
exit(0);
}
}while(1);
}
void Create()
{
fp1=fopen("temp.txt","w");
printf("\n\tEnter the text and press '.' to save\n\n\t");
while(1)
{
c=getchar();
fputc(c,fp1);
if(c == '.')
{
fclose(fp1);
printf("\n\tEnter then new filename: ");
scanf("%s",fn);
fp1=fopen("temp.txt","r");
fp2=fopen(fn,"w");
while(!feof(fp1))
{
c=getc(fp1);
putc(c,fp2);
}
fclose(fp2);
break;
}}
}
void Display()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end1;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
end1:
fclose(fp1);
printf("\n\n\tPress any key to continue...");
getch();
}
void Delete()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end2;
}
fclose(fp1);
if(remove(fn)==0)
{
printf("\n\n\tFile has been deleted successfully!");
goto end2;
}
else
printf("\n\tError!\n");
end2: printf("\n\n\tPress any key to continue...");
getch();
}
void Append()
{
printf("\n\tEnter the file name: ");
scanf("%s",fn);
fp1=fopen(fn,"r");
if(fp1==NULL)
{
printf("\n\tFile not found!");
goto end3;
}
while(!feof(fp1))
{
c=getc(fp1);
printf("%c",c);
}
fclose(fp1);
printf("\n\tType the text and press 'Ctrl+S' to append.\n");
fp1=fopen(fn,"a");
while(1)
{
c=getch();
if(c==19)
goto end3;
if(c==13)
{
c='\n';
printf("\n\t");
fputc(c,fp1);
}
else
{
printf("%c",c);
fputc(c,fp1);
}
}
end3: fclose(fp1);
getch();
}
Developed Skill
1 Information Collection
2 Information Analysis
3 Design of Project
4 Programming Skills
5 Leadership
6 Team Management
7 Planning
8 Critical Thinking
9 Task Management
10 Creativity
9.0. Applications of this Micro-Project :
A Stack can be used for evaluating expressions consisting of operands and operators.
10.0. Conclusion :
We all by now understand that editors are the program which is used to create, edit and
modify a document. A document may include some images, files, text, equations, and
diagrams as well. But we will be limited to text editors only whose main elements are
characterstrings.