You are on page 1of 21

lOMoARcPSD|30954265

DSU Final Micro Project 1

Computer Networking (Bharati Vidyapeeth College of Engineering, Navi Mumbai)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Ronit Patil (ronitpatil2957@gmail.com)
lOMoARcPSD|30954265

BHARATI VIDYAPEETH’S

BHARATI VIDYAPEETH’S INSTITUTE OF TECHNOLOGY (POLY.)


KOLHAPUR. DEPARTMENT OF COMPUTER ENGINEERING
ACADEMIC YEAR 2022-23

MICRO-PROJECT REPORT

Name of Program : Diploma in Computer Engineering


Semester: CO3I

Name of Course and Code: Data structure using c

(22317)

Group Number: 9

Title of the Micro-Project: Text Editor Using Stack

1. Mr. Manish Mahendra Patil


2. Mr. Varad Amar Kokate
3. Mr. Harshavardan Dhanaji Patil
Name of Team Members: 4. Mr. Shreyas Rajesh Kumbhar

5. Mr. Ravi Sahebrao Pardhi

Mrs. Mane V.M.

Sign of the Project Guide

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

Maharashtra State
Board of Technical Education, Mumbai
Year 2022-23
CERTIFICATE
This is to certify that of 1. Mr. Manish Mahendra Patil

2. Mr. Varad Amar Kokate

3. Mr. Harshavardan Dhanaji Patil

4. Mr. Shreyas Rajesh Kumbhar


5. Mr. Ravi Sahebrao Pardhi

Diploma In Computer Engineering of Bharati Vidyapeeth’s Institute of Technology


(Polytechnic),Kolhapur (Code: 0540) has completed Micro project of the course Data
Structures using ‘C’ (22317) entitled “TEXT EDITOR USING STACK”as prescribed in the
curriculum for the academic year 2022-23

Place: Kolhapur Group No: 9

Date: _____________________

Course In-charge Head of Department

Mrs. Mane V.M. Mrs. Mane V.M.

Seal of institute

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

PART A – Micro-Project Proposal

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.0. Aim of Project


 Understand the stack procedure.
 Stacks are be used for systematic Memory Management
 Implements operations on stack .
 Stack is a simple linear data structure used for storing data.

3.0 Intended Course Outcomes


 Perform basic operation on arrays.

 Apply different searching and sorting techniques.

 Implement basic operation on stack and queue using array representation.

 Implement basic operation on link list.

 Implement program to create and traverse tree to solve problems

4.0. Proposed Methodology


1) Algorithm of Text Editor Using Stack

1.Display options new, open and exit and get choice.


2.If choice is 1 , call Create() function.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

3.If choice is 2, call Display() function.


4.If choice is 3, call Append() function.
5.If choice is 4, call Delete() function.
6.If choice is 5, call Display() function.
7.Create() 7.1 Get the file name and open it in write mode.

7.2 Get the text from the user to write it.


8.Display()
8.1 Get the file name from user.
8.2 Check whether the file is present or not.
8.2 If present then display the contents of the file.
9.Append()
9.1 Get the file name from user.
9.2 Check whether the file is present or not.
9.3 If present then append the file by getting the text to add with the existing file.
10. Delete()
10.1 Get the file name from user.

2) FLOWCHART:

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

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

5.0. Resources Required

Sr. Name of Specifications Quantity Remark


No. Resource/material

1 Hardware:Computer Computer(i3_i5 1 -

System preferable),RAM minimum


2GB and onward but not
limited to

2 Operating System Window XP/window 7/LINUX 1 -

version 5.0 or later

3 Turbo C++ IDE 1 -

Learning Resources
Sr. No. Title of Book Author Publication
01 Data structure using c Reema Thareja Oxford University Press

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

Software Learning Resources


1. https://iq.opengenus.org/data-structures-used-in-text-editor/
2. http://algorithmsforgeeks.blogspot.com/2017/03/implement-text-editor-using-
stack.html
3. https://www.geeksforgeeks.org/micro-lightweight-terminal-based-text-editor/

6.0. Name Of Team Members :


Sr. No Name Of Student Roll
No
1 Manish Mahendra Patil 2038
2 Varad Amar Kokate 2026
3 Harshvardhan Dhanaji Patil 2037
4 Shreyas Rajesh Kumbhar 2047
5 Ravi Sahebrao Pardhi 2033

Name of Programme: Computer Engineering Semester: CO3I

Course Title: Data structure using c Code: 22317

Title of the Micro-Project: Text editor using stack

Name of subject Teacher: Mrs. Mane V.M.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

S. No./ Details of activity Planned Planned Name of


week Start date Finish date Responsible
Team
Members
1. Topics given by Subject Teacher and 18-08-2022 25-08-2022
discussed on given topic with all members.

2. Collection of information related to the 25-08-2022 01-09-2022


topic.
3. Planning of project. 1-09-2022 08-09-2022
4. Analyze the collected data and finalize 08-09-2022 15-09-2022
structure of project.
5. Distribution of task and discussion of roles 15-09-2022 22-09-2022
and responsibilities of each member. Manish
6. Design of micro-project 22-09-2022 29-09-2022 Varad
7. Design of micro-project 29-09-2022 06-10-2022 Harsh
8. Implementation 06-10-2022 13-10-2022 Ravi
Shrayas
9. Implementation 13-10-2022 20-10-2022
10. Implementation 20-10-2022 27-10-2022
11. Implementation 27-10-2022 03-11-2022
12. Report Preparation 03-11-2022 10-11-2022
13. Report Submission 10-11-2022 17-11-2022
14. PPT Preparation 17-11-2022 24-11-2022
15. Presentation 24-11-2022 01-12-2022
16. Submission of Micro project 01-12-2022 08-12-2022

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

Name of Course Teacher: Mrs. Mane V.M Sign: __________


PART B – Micro-Project Report
Title of Micro-Project:
Text Editor Using Stack
1.0. Rationale
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.0. Aim of Project


 Understand the stack procedure.
 Stacks are be used for systematic Memory Management
 Implements operations on stack .
 Stack is a simple linear data structure used for storing data.

3.0. Course Outcomes Addressed


 Perform basic operation on arrays.

 Implement basic operation on stack and queue using array representation.

 Implement basic operation on link list.

4.0. Literature Review


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

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

main elements are character strings.


The document editing process mainly compromises of the following four tasks :

5.0. Actual Methodology Followed :


A stack is an abstract data type that serves as a collection of elements, with two principal
operations: push, which adds an element to the collection, and pop, which removes the
most recently added element that was not yet removed.

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.

 Formatting : Visibility on display screen.


 Filtering : Finding out the main/important subset.
 Traveling : Locating the area of interest.

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.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

 Output Devices : TFT monitors, Printers, Teletypewriters, Cathode ray tube


technology, Advanced CRT terminals.
 Interaction language : The interaction language could be, typing oriented or text
command-oriented or could be menu oriented user interface as well. Typing or text
command-oriented interaction language is very old used with the oldest editors, in the
form of commands, use of functions and control keys etc. Menu oriented interface has
a menu with the set of multiple choice of text strings. The display area is limited and
the menus can be turned on/off by the user.
 Text editors deal with manipulating text and provide features to enhance the experience.
As mentioned before, the major functionalities of text editors are: inserting, deleting,
and viewing text. Additonal features that are practically required to even compete with
other text editors are:find and replace, copy/cut and paste, text formatting, sentence
highlighting, and etc.

 Designing a Text Editor

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.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

Data Structures:

Functional data structures will only be briefly included at the end


It's important to note that text editors will often use a few data structures to implement
different functionalities.

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).

Plain text exclusively consists of character representation. Each character is represented by a


fixed-length sequence of one, two, or four bytes, or as a variable-length sequence of one to
four bytes, in accordance to specific character encoding conventions, such
as ASCII, ISO/IEC 2022, Shift JIS, UTF-8, or UTF-16. These conventions define many printable
characters, but also non-printing characters that control the flow of the text, such
as space, line break, and page break. Plain text contains no other information about the text
itself, not even the character encoding convention employed. Plain text is stored in text files,
although text files do not exclusively store plain text. Since the early days of computers, plain
text was (once by necessity and now by convention) generally displayed using a monospace
font, such that horizontal alignment and columnar formatting were sometimes done using
whitespace characters.

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).

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

3) FLOWCHART:

6.0. Actual Resources Used :

Sr. No. Name of Specifications Quantity Remark


Resource/material

1 Hardware: Computer(i3_i5 1 -

Computer System preferable),RAM minimum


2GB and onward but not
limited to

2 Operating System Window XP/window 7/LINUX 1 -

version 5.0 or later

3 Turbo C++ IDE 1 -

1) Learning Resources
Sr. No. Title of Book Author Publication

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

01 Data structure using c Reema Thareja Oxford University Press

2) Software Learning Resources


1. https://iq.opengenus.org/data-structures-used-in-text-editor/
2. http://algorithmsforgeeks.blogspot.com/2017/03/implement-text-editor-using-
3. https://www.geeksforgeeks.org/micro-lightweight-terminal-based-text-editor/

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:

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

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))

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

{
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);

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

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);
}

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

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();
}

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

8.0. Skill Developed / learning outcomes :


Sr. No. Technical/ Non-technical Skills Tick Mark( √) for

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

11 Develop Project in deadline driven environment


12 Familiar with subject Knowledge: DSU


9.0. Applications of this Micro-Project :
 A Stack can be used for evaluating expressions consisting of operands and operators.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)


lOMoARcPSD|30954265

 Stacks can be used for Backtracking, i.e., to check parenthesis matching in an


expression.

 It can also be used to convert one form of expression to another form.

 It can be used for systematic Memory Management.

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.

Downloaded by Ronit Patil (ronitpatil2957@gmail.com)

You might also like