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

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

Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfCode In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
aishwaryaequipment
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
MAHESHV559910
 

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

Lecture 1
Lecture 1Lecture 1
Lecture 1
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
Write a LEX program that does the following1. Reads a C++ pro.docx
Write a LEX program that does the following1. Reads a C++ pro.docxWrite a LEX program that does the following1. Reads a C++ pro.docx
Write a LEX program that does the following1. Reads a C++ pro.docx
 
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdfCode In PythonFile 1 main.pyYou will implement two algorithms t.pdf
Code In PythonFile 1 main.pyYou will implement two algorithms t.pdf
 
Btech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c languageBtech i pic u-2 datatypes and variables in c language
Btech i pic u-2 datatypes and variables in c language
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
434090527-C-Cheat-Sheet. pdf C# program
434090527-C-Cheat-Sheet. pdf  C# program434090527-C-Cheat-Sheet. pdf  C# program
434090527-C-Cheat-Sheet. pdf C# program
 
Module 1 PCD.docx
Module 1 PCD.docxModule 1 PCD.docx
Module 1 PCD.docx
 
Mca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c languageMca i pic u-2 datatypes and variables in c language
Mca i pic u-2 datatypes and variables in c language
 
Diploma ii cfpc u-2 datatypes and variables in c language
Diploma ii  cfpc u-2 datatypes and variables in c languageDiploma ii  cfpc u-2 datatypes and variables in c language
Diploma ii cfpc u-2 datatypes and variables in c language
 
C language
C language C language
C language
 
Unit 2 introduction to c programming
Unit 2   introduction to c programmingUnit 2   introduction to c programming
Unit 2 introduction to c programming
 
C-PROGRAM
C-PROGRAMC-PROGRAM
C-PROGRAM
 
Sorting with Linked-List Write a c++ program to read a series of integ.pdf
Sorting with Linked-List Write a c++ program to read a series of integ.pdfSorting with Linked-List Write a c++ program to read a series of integ.pdf
Sorting with Linked-List Write a c++ program to read a series of integ.pdf
 
Basics Of C++.pptx
Basics Of C++.pptxBasics Of C++.pptx
Basics Of C++.pptx
 
Python workshop
Python workshopPython workshop
Python workshop
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branchComputer experiments   1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
 
Bsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c languageBsc cs i pic u-2 datatypes and variables in c language
Bsc cs i pic u-2 datatypes and variables in c language
 
C Lang notes.ppt
C Lang notes.pptC Lang notes.ppt
C Lang notes.ppt
 

More from artimagein

Eratosthenes Estimation of the Circumference of the Earth This que.pdf
Eratosthenes Estimation of the Circumference of the Earth  This que.pdfEratosthenes Estimation of the Circumference of the Earth  This que.pdf
Eratosthenes Estimation of the Circumference of the Earth This que.pdf
artimagein
 
Ella is a 15-year old high-school freshman. She lives in a small sub.pdf
Ella is a 15-year old high-school freshman. She lives in a small sub.pdfElla is a 15-year old high-school freshman. She lives in a small sub.pdf
Ella is a 15-year old high-school freshman. She lives in a small sub.pdf
artimagein
 
Companies and people often buy and sell stocks. Often they buy th.pdf
Companies and people often buy and sell stocks. Often they buy th.pdfCompanies and people often buy and sell stocks. Often they buy th.pdf
Companies and people often buy and sell stocks. Often they buy th.pdf
artimagein
 

More from artimagein (20)

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

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
Avinash Rai
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 

Recently uploaded (20)

Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Forest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDFForest and Wildlife Resources Class 10 Free Study Material PDF
Forest and Wildlife Resources Class 10 Free Study Material PDF
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 

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