SlideShare a Scribd company logo
please help!! C++ Program D@t@ Structur3ss class
please comment code!
Create all!! Code Using Doubly Linked List In this project, you should write a simple line editor.
Keep the entire text on a linked list, one line in a separate node. Stan the program with entering
EDIT file, after which a prompt appeals along with the line number. If the letter I is entered with
a number n following it. then insert the text to be followed before line n. If I is not followed by a
number, then insert the text before the current line. If D is entered with two numbers n1 and m.
one n. or no member following it. then delete lines 11 through 111. line 11. or the current line.
Do the same with the command L. which stands for listing lines. If A is entered, then append the
text to the existing lines. Entry E signifies exit and saving the text in a file. Here is an Example:
Solution
#include
#include
#include
typedef struct Node
{
char character[80];
Node *next, *pre;
}Line;
Line *currentline;
Line *firstline;
Node *head, *tail;
int col;
void createfirstline()
{
Node *p;
p = new Node;
currentline = p;
head = currentline;
tail = currentline;
col = -1;
}
void newline()
{
Node *p;
p = new Node;
p -> next = NULL;
p->pre = currentline;
currentline->next = p;
tail = p;
currentline=p;
col = 0;
}
void createnewline()
{
Node *p;
p = new Node;
p -> next = NULL;
if (head == NULL)
{
head = p;
tail = p;
}
else
{
Node *q = tail;
q->next = p;
p->pre = q;
}
tail = p;
currentline = p;
}
void main()
{
cout << "Enter string: ";
char string[30];
cin.getline (string,30);
ifstream instream;
instream.open(string);
char reading;
currentline = firstline;
createfirstline();
while(instream.read(&reading,sizeof(reading)))
{
if (reading == ' ')
newline();
else
{
col++;
currentline->character[col] = reading;
}
}
instream.close();
}

More Related Content

PDF
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
DOCX
Problem 1- Text Editor using files and strings using C++ In this proje.docx
PPTX
Implemention of Linked list concept in Data Structures
PDF
This assignment and the next (#5) involve design and development of a.pdf
PPTX
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
PPT
Algo>ADT list & linked list
PPTX
CSE240 Doubly Linked Lists
PPTX
DSA(1).pptx
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
Problem 1- Text Editor using files and strings using C++ In this proje.docx
Implemention of Linked list concept in Data Structures
This assignment and the next (#5) involve design and development of a.pdf
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
Algo>ADT list & linked list
CSE240 Doubly Linked Lists
DSA(1).pptx

Similar to please help!! C++ Program D@t@ Structur3ss classplease comment cod.pdf (20)

PDF
File name a2.cppTaskFor this assignment, you are required to ei.pdf
PDF
In this lab we will write code for working with a Linked List. Node .pdf
PDF
#include iostream #include cstring #include vector #i.pdf
PPTX
Data structure and algorithm list structures
PPTX
Linked lists linked lists vs Arrays.pptx
PPTX
Stack implementation using linked list ppt
PPTX
Ll.pptx
PPTX
linked list.pptx
DOCX
C++ Please write the whole code that is needed for this assignment- wr.docx
PDF
Hello guys please make sure program runs well USING C anyth.pdf
PPTX
linkedlist.pptx
PPTX
Deleting a node from the list(SINGLE LINKED LIST)
PDF
Data Structures in C++I am really new to C++, so links are really .pdf
PDF
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
PPTX
linked list_MODULE 3.pptx ppt on the linked list
PPT
Data structures cs301 power point slides lecture 03
PPTX
linkedlistforslideshare-210123143943.pptx
PPTX
Data Structures_Linked List
PPTX
Data structure and algorithms chapter three LINKED LIST
DOCX
C++ please put everthing after you answer it- thanks Complete the stub.docx
File name a2.cppTaskFor this assignment, you are required to ei.pdf
In this lab we will write code for working with a Linked List. Node .pdf
#include iostream #include cstring #include vector #i.pdf
Data structure and algorithm list structures
Linked lists linked lists vs Arrays.pptx
Stack implementation using linked list ppt
Ll.pptx
linked list.pptx
C++ Please write the whole code that is needed for this assignment- wr.docx
Hello guys please make sure program runs well USING C anyth.pdf
linkedlist.pptx
Deleting a node from the list(SINGLE LINKED LIST)
Data Structures in C++I am really new to C++, so links are really .pdf
Homework 05 - Linked Lists (C++)(1) Implement the concepts of a un.pdf
linked list_MODULE 3.pptx ppt on the linked list
Data structures cs301 power point slides lecture 03
linkedlistforslideshare-210123143943.pptx
Data Structures_Linked List
Data structure and algorithms chapter three LINKED LIST
C++ please put everthing after you answer it- thanks Complete the stub.docx
Ad

More from artimagein (20)

PDF
Eratosthenes Estimation of the Circumference of the Earth This que.pdf
PDF
Can we measure stress directlySolutionStress is defined as in.pdf
PDF
Find the derivative of the function y = e^xlnxSolution .pdf
PDF
Explain which type of packet, TCP or UDP, is easier to spoof and why.pdf
PDF
Ella is a 15-year old high-school freshman. She lives in a small sub.pdf
PDF
Companies and people often buy and sell stocks. Often they buy th.pdf
PDF
What experiment could you run on fractions collected by differential.pdf
PDF
Write a C program Write functions that return the following values. .pdf
PDF
a. Name and explain the responsibilities of each MAC sub layer.b. .pdf
PDF
What is Binary Coded DecimalSolutionBinary Coded Decimal is a .pdf
PDF
What is the proper pseudocode for the following java codeimport j.pdf
PDF
What are ways in which brands cut through advertising clutterSo.pdf
PDF
What are cytoplasmic determinants What is the relevance of the yell.pdf
PDF
Urinalysis questions- What if SSA reaction tested negative What .pdf
PDF
The probability that John Doe is called to serve on a committee is ..pdf
PDF
answer sporophyte or gametophytewhich generation is a pine tree.pdf
PDF
Additional activity of this leads to reduced transport of iron to the.pdf
PDF
Significance of Discoveries in Genetics and DNA Our understanding of.pdf
PDF
Show Punnett squares for incomplete dominance in which a purple flowe.pdf
PDF
Polar populations. Suppose at each point on Earth you count the numb.pdf
Eratosthenes Estimation of the Circumference of the Earth This que.pdf
Can we measure stress directlySolutionStress is defined as in.pdf
Find the derivative of the function y = e^xlnxSolution .pdf
Explain which type of packet, TCP or UDP, is easier to spoof and why.pdf
Ella is a 15-year old high-school freshman. She lives in a small sub.pdf
Companies and people often buy and sell stocks. Often they buy th.pdf
What experiment could you run on fractions collected by differential.pdf
Write a C program Write functions that return the following values. .pdf
a. Name and explain the responsibilities of each MAC sub layer.b. .pdf
What is Binary Coded DecimalSolutionBinary Coded Decimal is a .pdf
What is the proper pseudocode for the following java codeimport j.pdf
What are ways in which brands cut through advertising clutterSo.pdf
What are cytoplasmic determinants What is the relevance of the yell.pdf
Urinalysis questions- What if SSA reaction tested negative What .pdf
The probability that John Doe is called to serve on a committee is ..pdf
answer sporophyte or gametophytewhich generation is a pine tree.pdf
Additional activity of this leads to reduced transport of iron to the.pdf
Significance of Discoveries in Genetics and DNA Our understanding of.pdf
Show Punnett squares for incomplete dominance in which a purple flowe.pdf
Polar populations. Suppose at each point on Earth you count the numb.pdf
Ad

Recently uploaded (20)

PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Institutional Correction lecture only . . .
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharma ospi slides which help in ospi learning
PDF
Anesthesia in Laparoscopic Surgery in India
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O7-L3 Supply Chain Operations - ICLT Program
Institutional Correction lecture only . . .
Module 4: Burden of Disease Tutorial Slides S2 2025
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Microbial diseases, their pathogenesis and prophylaxis
Supply Chain Operations Speaking Notes -ICLT Program
VCE English Exam - Section C Student Revision Booklet
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Final Presentation General Medicine 03-08-2024.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Final Presentation General Medicine 03-08-2024.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharma ospi slides which help in ospi learning
Anesthesia in Laparoscopic Surgery in India

please help!! C++ Program D@t@ Structur3ss classplease comment cod.pdf

  • 1. please help!! C++ Program D@t@ Structur3ss class please comment code! Create all!! Code Using Doubly Linked List In this project, you should write a simple line editor. Keep the entire text on a linked list, one line in a separate node. Stan the program with entering EDIT file, after which a prompt appeals along with the line number. If the letter I is entered with a number n following it. then insert the text to be followed before line n. If I is not followed by a number, then insert the text before the current line. If D is entered with two numbers n1 and m. one n. or no member following it. then delete lines 11 through 111. line 11. or the current line. Do the same with the command L. which stands for listing lines. If A is entered, then append the text to the existing lines. Entry E signifies exit and saving the text in a file. Here is an Example: Solution #include #include #include typedef struct Node { char character[80]; Node *next, *pre; }Line; Line *currentline; Line *firstline; Node *head, *tail; int col; void createfirstline() { Node *p; p = new Node; currentline = p; head = currentline; tail = currentline; col = -1; } void newline()
  • 2. { Node *p; p = new Node; p -> next = NULL; p->pre = currentline; currentline->next = p; tail = p; currentline=p; col = 0; } void createnewline() { Node *p; p = new Node; p -> next = NULL; if (head == NULL) { head = p; tail = p; } else { Node *q = tail; q->next = p; p->pre = q; } tail = p; currentline = p; } void main() { cout << "Enter string: "; char string[30]; cin.getline (string,30); ifstream instream;
  • 3. instream.open(string); char reading; currentline = firstline; createfirstline(); while(instream.read(&reading,sizeof(reading))) { if (reading == ' ') newline(); else { col++; currentline->character[col] = reading; } } instream.close(); }