SlideShare a Scribd company logo
Please teach me how to fix the errors and where should be modified. Thank you!
"Program generated too much output. Output restricted to 50000 characters. Check program for
any unterminated loops generating output."
LinkedList.cpp
LinkedList::LinkedList() {
head = new Node;
head->next = NULL;
length = 0;
}
void LinkedList::insertNode(Sales dataIn) {
/* Write your code here */
Node *newNode;
Node *pCur;
Node *pPre;
newNode = new Node;
newNode->data = dataIn;
pPre = head;
pCur = head->next;
while (pCur != NULL && pCur->data.getName() < dataIn.getName()) {
pPre = pCur;
pCur = pCur->next;
}
pPre->next = newNode;
newNode->next = pCur;
length++;
}
bool LinkedList::deleteNode(string target){
Node *pCur;
Node *pPre;
bool deleted = false;
pPre = head;
pCur = head->next;
while (pCur != NULL && pCur->data.getName() < target) {
pPre = pCur;
pCur = pCur->next;
}
if (pCur != NULL && pCur->data.getName() == target) {
pPre->next = pCur->next;
delete pCur;
deleted = true;
length--;
}
return deleted;
}
void LinkedList::displayList() const{
Node *pCur;
pCur = head->next;
while (pCur) {
cout << pCur->data;
pCur = pCur->next;
}
cout << endl;
}
void LinkedList::displayList(int year) const {
Node *pCur;
pCur = head->next;
int cnt = 0;
while (pCur) {
if (pCur->data.getYear() == year){
cout << pCur->data;
cnt++;
}
pCur = pCur->next;
}
if (cnt == 0){
cout << "N/A" << endl;
}
}
double LinkedList::average() const {
double total = 0.0;
double average;
Node *pCur;
pCur = head;
while (pCur != NULL) {
total += pCur->data.getAmount();
pCur = pCur->next;
}
average = total / static_cast(length);
return average;
}
bool LinkedList::searchList(string find, Sales &dataOut) const {
bool found = false;
Node *pCur;
pCur = head->next;
while (pCur != NULL && pCur->data.getName() < find) {
pCur = pCur->next;
}
if (pCur != NULL && pCur->data.getName() == find) {
dataOut = pCur->data;
found = true;
}
return found;
}
LinkedList::~LinkedList() {
Node *pCur;
Node *pNext;
pCur = head->next;
while(pCur != NULL) {
pNext = pCur->next;
delete pCur;
pCur = pNext;
}
delete head;
}
main.cpp
void buildList(const string &filename, LinkedList &list);
void deleteManager(LinkedList &list);
void searchManager(const LinkedList &list);
void displayManager(const LinkedList &list);
int main() {
string inputFileName;
LinkedList list;
cout << "Enter file name: ";
getline(cin, inputFileName);
buildList(inputFileName, list);
displayManager(list);
searchManager(list);
deleteManager(list);
displayManager(list);
return 0;
}
void buildList(const string &filename, LinkedList &list) {
ifstream inFile(filename);
cout <<"Reading data from "" << filename << ""n";
if(!inFile) {
cout << "Error opening the input file: ""<< filename << """ << endl;
exit(EXIT_FAILURE);
}
string id;
int year;
string name;
int amount;
string line;
while (getline(inFile, line) ) {
stringstream temp(line);
temp >> id >> year;
temp.ignore();
getline(temp, name, ';');
temp >> amount;
// create a Sales object and initialize it with data from file
Sales obj;
obj.setId(id);
obj.setYear(year);
obj.setName(name);
obj.setAmount(amount);
// call insert to insert this new Sales object into the sorted list
list.insertNode(obj);
}
inFile.close();
}
void deleteManager(LinkedList &list) {
string target = "";
cout << " Delete" << endl;
cout << "========" << endl;
while(target != "Q") {
cout << "Enter a name (or Q to stop deleting):" << endl;
getline(cin, target);
target[0] = toupper(target[0]);
if(target != "Q") {
if(list.deleteNode(target))
cout << target << " has been deleted!" << endl;
else
cout << target << " not found!" << endl;
}
}
cout << "___________________END DELETE SECTION_____" << endl;
}
void searchManager(const LinkedList &list) {
string target = "";
Sales obj;
cout << " Search" << endl;
cout << "========" << endl;
while (target != "Q") {
cout << "Enter a name (or Q to stop searching):" << endl;
getline(cin, target);
target[0] = toupper(target[0]);
if (target != "Q") {
if (list.searchList(target, obj))
obj.display();
else
cout << target << " not found!" << endl;
}
}
cout << "___________________END SEARCH SECTION _____" << endl;
}
void displayManager(const LinkedList &list) {
// Sub-functions of displayManager()
void showMenu(void);
string getOption(void);
void showHeader(string line);
string line = "==== ==================== =============n";
string option;
showMenu();
option = getOption();
while(option[0] != 'Q') {
switch (option[0]) {
case 'A':
showHeader(line);
list.displayList();
cout << line;
break;
case 'G':
cout << "Average (amount sold) $";
cout << setprecision(2) << fixed;
cout << list.average() << endl;
break;
case 'Y':
int year;
cout << "Enter year: " << endl;
cin >> year;
showHeader(line);
list.displayList(year);
cout << line;
break;
}
option = getOption();
}
cout << "Number of salespeople: " << list.getLength() << endl;
}
void showHeader(string line) {
cout << line;
cout << "Year" << " " << left << setw(20) << "Name"
<< " Amount Earned" << endl;
cout << line;
}
string getOption(void) {
string option;
cout << "What is your option [A/G/Y/Q]?" << endl;
cin >> option;
cin.ignore();
option[0] = toupper(option[0]);
while (option != "A" && option != "G" && option != "Y" && option != "Q") {
cout << "Invalid Option: Try again!";
cout << "What is your option [A/G/Y/Q]?" << endl;
cin >> option;
cin.ignore();
option[0] = toupper(option[0]);
}
return option;
}
void showMenu(void) {
cout << "The following reports are available: " << endl;
cout << "[A] - All" << endl
<< "[G] - Average" << endl
<< "[Y] - Year Hired" << endl
<< "[Q] - Quit" << endl;
}
Ad

More Related Content

Similar to Please teach me how to fix the errors and where should be modified. .pdf (20)

Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
Lakshmi Sarvani Videla
 
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
 #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
angelsfashion1
 
program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)
Ankit Gupta
 
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdflinked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
minorproject456
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementations
Rex Mwamba
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
Chaitanya Kn
 
C++ normal assignments by maharshi_jd.pdf
C++ normal assignments by maharshi_jd.pdfC++ normal assignments by maharshi_jd.pdf
C++ normal assignments by maharshi_jd.pdf
maharshi1731
 
#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf
harihelectronicspune
 
dynamicList.ppt
dynamicList.pptdynamicList.ppt
dynamicList.ppt
ssuser0be977
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdf
fantoosh1
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdf
flashfashioncasualwe
 
Arrays
ArraysArrays
Arrays
archikabhatia
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
Lakshmi Sarvani Videla
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
aathiauto
 
Opp compile
Opp compileOpp compile
Opp compile
Muhammad Faiz
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked List
PTCL
 
#include iostream #include cstring #include vector #i.pdf
 #include iostream #include cstring #include vector #i.pdf #include iostream #include cstring #include vector #i.pdf
#include iostream #include cstring #include vector #i.pdf
anandatalapatra
 
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdfC++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
aassecuritysystem
 
Rewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdfRewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdf
alphaagenciesindia
 
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdfincludestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
galagirishp
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
Lakshmi Sarvani Videla
 
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
 #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf #ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
#ifndef LINKED_LIST_ #define LINKED_LIST_ templateclass It.pdf
angelsfashion1
 
program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)program on string in java Lab file 2 (3-year)
program on string in java Lab file 2 (3-year)
Ankit Gupta
 
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdflinked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
linked listLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL.pdf
minorproject456
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementations
Rex Mwamba
 
C++ normal assignments by maharshi_jd.pdf
C++ normal assignments by maharshi_jd.pdfC++ normal assignments by maharshi_jd.pdf
C++ normal assignments by maharshi_jd.pdf
maharshi1731
 
#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf
harihelectronicspune
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdf
fantoosh1
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdf
flashfashioncasualwe
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
aathiauto
 
Queue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked ListQueue Implementation Using Array & Linked List
Queue Implementation Using Array & Linked List
PTCL
 
#include iostream #include cstring #include vector #i.pdf
 #include iostream #include cstring #include vector #i.pdf #include iostream #include cstring #include vector #i.pdf
#include iostream #include cstring #include vector #i.pdf
anandatalapatra
 
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdfC++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
C++ Language -- Dynamic Memory -- There are 7 files in this project- a.pdf
aassecuritysystem
 
Rewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdfRewrite this code so it can use a generic type instead of integers. .pdf
Rewrite this code so it can use a generic type instead of integers. .pdf
alphaagenciesindia
 
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdfincludestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
galagirishp
 

More from amarndsons (20)

Plot the marginal utility of food. Remember to plot using midpoints#.pdf
Plot the marginal utility of food. Remember to plot using midpoints#.pdfPlot the marginal utility of food. Remember to plot using midpoints#.pdf
Plot the marginal utility of food. Remember to plot using midpoints#.pdf
amarndsons
 
Please write the mysh program in C and follow the guidelines specifi.pdf
Please write the mysh program in C and follow the guidelines specifi.pdfPlease write the mysh program in C and follow the guidelines specifi.pdf
Please write the mysh program in C and follow the guidelines specifi.pdf
amarndsons
 
Please write the program mysh in C programming language and follow.pdf
Please write the program mysh in C programming language and follow.pdfPlease write the program mysh in C programming language and follow.pdf
Please write the program mysh in C programming language and follow.pdf
amarndsons
 
Please write the C++ code that would display the exact same output a.pdf
Please write the C++ code that would display the exact same output a.pdfPlease write the C++ code that would display the exact same output a.pdf
Please write the C++ code that would display the exact same output a.pdf
amarndsons
 
please write in C programming Write in C code that is able to rea.pdf
please write in C programming  Write in C code that is able to rea.pdfplease write in C programming  Write in C code that is able to rea.pdf
please write in C programming Write in C code that is able to rea.pdf
amarndsons
 
please will you answer the following questions about chromatin struc.pdf
please will you answer the following questions about chromatin struc.pdfplease will you answer the following questions about chromatin struc.pdf
please will you answer the following questions about chromatin struc.pdf
amarndsons
 
Please write a detailed post responding to this question.Question.pdf
Please write a detailed post responding to this question.Question.pdfPlease write a detailed post responding to this question.Question.pdf
Please write a detailed post responding to this question.Question.pdf
amarndsons
 
Please write a detailed assessment of the long-term advantages and d.pdf
Please write a detailed assessment of the long-term advantages and d.pdfPlease write a detailed assessment of the long-term advantages and d.pdf
Please write a detailed assessment of the long-term advantages and d.pdf
amarndsons
 
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdfPLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
amarndsons
 
Please use your own word and dont copy and paste the anwser from ke.pdf
Please use your own word and dont copy and paste the anwser from ke.pdfPlease use your own word and dont copy and paste the anwser from ke.pdf
Please use your own word and dont copy and paste the anwser from ke.pdf
amarndsons
 
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdfPlease use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
amarndsons
 
Please state whether each of the following statements is True or Fal.pdf
Please state whether each of the following statements is True or Fal.pdfPlease state whether each of the following statements is True or Fal.pdf
Please state whether each of the following statements is True or Fal.pdf
amarndsons
 
Please tell me why I get this error in my code I have the screen sh.pdf
Please tell me why I get this error in my code I have the screen sh.pdfPlease tell me why I get this error in my code I have the screen sh.pdf
Please tell me why I get this error in my code I have the screen sh.pdf
amarndsons
 
please solve this problem using R language 3. The following data .pdf
please solve this problem using R language  3. The following data .pdfplease solve this problem using R language  3. The following data .pdf
please solve this problem using R language 3. The following data .pdf
amarndsons
 
Please show all the necessary steps to find the above op code Q2. (1.pdf
Please show all the necessary steps to find the above op code Q2. (1.pdfPlease show all the necessary steps to find the above op code Q2. (1.pdf
Please show all the necessary steps to find the above op code Q2. (1.pdf
amarndsons
 
Please show all steps i want to understand whats happening. 2- Solve.pdf
Please show all steps i want to understand whats happening. 2- Solve.pdfPlease show all steps i want to understand whats happening. 2- Solve.pdf
Please show all steps i want to understand whats happening. 2- Solve.pdf
amarndsons
 
Please Show all work. 1. Show that the language L1={ann is prime } .pdf
Please Show all work. 1. Show that the language L1={ann is prime } .pdfPlease Show all work. 1. Show that the language L1={ann is prime } .pdf
Please Show all work. 1. Show that the language L1={ann is prime } .pdf
amarndsons
 
please show your work (Remember You may find the standard normal ta.pdf
please show your work (Remember You may find the standard normal ta.pdfplease show your work (Remember You may find the standard normal ta.pdf
please show your work (Remember You may find the standard normal ta.pdf
amarndsons
 
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdfPlease show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
amarndsons
 
Please show all work and explain the answer! which of the following .pdf
Please show all work and explain the answer! which of the following .pdfPlease show all work and explain the answer! which of the following .pdf
Please show all work and explain the answer! which of the following .pdf
amarndsons
 
Plot the marginal utility of food. Remember to plot using midpoints#.pdf
Plot the marginal utility of food. Remember to plot using midpoints#.pdfPlot the marginal utility of food. Remember to plot using midpoints#.pdf
Plot the marginal utility of food. Remember to plot using midpoints#.pdf
amarndsons
 
Please write the mysh program in C and follow the guidelines specifi.pdf
Please write the mysh program in C and follow the guidelines specifi.pdfPlease write the mysh program in C and follow the guidelines specifi.pdf
Please write the mysh program in C and follow the guidelines specifi.pdf
amarndsons
 
Please write the program mysh in C programming language and follow.pdf
Please write the program mysh in C programming language and follow.pdfPlease write the program mysh in C programming language and follow.pdf
Please write the program mysh in C programming language and follow.pdf
amarndsons
 
Please write the C++ code that would display the exact same output a.pdf
Please write the C++ code that would display the exact same output a.pdfPlease write the C++ code that would display the exact same output a.pdf
Please write the C++ code that would display the exact same output a.pdf
amarndsons
 
please write in C programming Write in C code that is able to rea.pdf
please write in C programming  Write in C code that is able to rea.pdfplease write in C programming  Write in C code that is able to rea.pdf
please write in C programming Write in C code that is able to rea.pdf
amarndsons
 
please will you answer the following questions about chromatin struc.pdf
please will you answer the following questions about chromatin struc.pdfplease will you answer the following questions about chromatin struc.pdf
please will you answer the following questions about chromatin struc.pdf
amarndsons
 
Please write a detailed post responding to this question.Question.pdf
Please write a detailed post responding to this question.Question.pdfPlease write a detailed post responding to this question.Question.pdf
Please write a detailed post responding to this question.Question.pdf
amarndsons
 
Please write a detailed assessment of the long-term advantages and d.pdf
Please write a detailed assessment of the long-term advantages and d.pdfPlease write a detailed assessment of the long-term advantages and d.pdf
Please write a detailed assessment of the long-term advantages and d.pdf
amarndsons
 
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdfPLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
PLEASE USE TuProlog for this. Also the facts need to be Binary Fac.pdf
amarndsons
 
Please use your own word and dont copy and paste the anwser from ke.pdf
Please use your own word and dont copy and paste the anwser from ke.pdfPlease use your own word and dont copy and paste the anwser from ke.pdf
Please use your own word and dont copy and paste the anwser from ke.pdf
amarndsons
 
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdfPlease use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
Please use one of the 2 Excel files (BirdSrtike or Super-SampleStore.pdf
amarndsons
 
Please state whether each of the following statements is True or Fal.pdf
Please state whether each of the following statements is True or Fal.pdfPlease state whether each of the following statements is True or Fal.pdf
Please state whether each of the following statements is True or Fal.pdf
amarndsons
 
Please tell me why I get this error in my code I have the screen sh.pdf
Please tell me why I get this error in my code I have the screen sh.pdfPlease tell me why I get this error in my code I have the screen sh.pdf
Please tell me why I get this error in my code I have the screen sh.pdf
amarndsons
 
please solve this problem using R language 3. The following data .pdf
please solve this problem using R language  3. The following data .pdfplease solve this problem using R language  3. The following data .pdf
please solve this problem using R language 3. The following data .pdf
amarndsons
 
Please show all the necessary steps to find the above op code Q2. (1.pdf
Please show all the necessary steps to find the above op code Q2. (1.pdfPlease show all the necessary steps to find the above op code Q2. (1.pdf
Please show all the necessary steps to find the above op code Q2. (1.pdf
amarndsons
 
Please show all steps i want to understand whats happening. 2- Solve.pdf
Please show all steps i want to understand whats happening. 2- Solve.pdfPlease show all steps i want to understand whats happening. 2- Solve.pdf
Please show all steps i want to understand whats happening. 2- Solve.pdf
amarndsons
 
Please Show all work. 1. Show that the language L1={ann is prime } .pdf
Please Show all work. 1. Show that the language L1={ann is prime } .pdfPlease Show all work. 1. Show that the language L1={ann is prime } .pdf
Please Show all work. 1. Show that the language L1={ann is prime } .pdf
amarndsons
 
please show your work (Remember You may find the standard normal ta.pdf
please show your work (Remember You may find the standard normal ta.pdfplease show your work (Remember You may find the standard normal ta.pdf
please show your work (Remember You may find the standard normal ta.pdf
amarndsons
 
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdfPlease show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
Please show the math for the stepsPart 1A.Part 1BPart 1C Us.pdf
amarndsons
 
Please show all work and explain the answer! which of the following .pdf
Please show all work and explain the answer! which of the following .pdfPlease show all work and explain the answer! which of the following .pdf
Please show all work and explain the answer! which of the following .pdf
amarndsons
 
Ad

Recently uploaded (20)

Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............
19lburrell
 
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdfIPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
Quiz Club of PSG College of Arts & Science
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
The History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.pptThe History of Kashmir Lohar Dynasty NEP.ppt
The History of Kashmir Lohar Dynasty NEP.ppt
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-17-2025 .pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-17-2025  .pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-17-2025  .pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-17-2025 .pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
MICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdfMICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdf
DHARMENDRA SAHU
 
Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............Peer Assesment- Libby.docx..............
Peer Assesment- Libby.docx..............
19lburrell
 
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx2025 The Senior Landscape and SET plan preparations.pptx
2025 The Senior Landscape and SET plan preparations.pptx
mansk2
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
How to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 InventoryHow to Manage Manual Reordering Rule in Odoo 18 Inventory
How to Manage Manual Reordering Rule in Odoo 18 Inventory
Celine George
 
MICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdfMICROBIAL GENETICS -tranformation and tranduction.pdf
MICROBIAL GENETICS -tranformation and tranduction.pdf
DHARMENDRA SAHU
 
Ad

Please teach me how to fix the errors and where should be modified. .pdf

  • 1. Please teach me how to fix the errors and where should be modified. Thank you! "Program generated too much output. Output restricted to 50000 characters. Check program for any unterminated loops generating output." LinkedList.cpp LinkedList::LinkedList() { head = new Node; head->next = NULL; length = 0; } void LinkedList::insertNode(Sales dataIn) { /* Write your code here */ Node *newNode; Node *pCur; Node *pPre; newNode = new Node; newNode->data = dataIn; pPre = head; pCur = head->next; while (pCur != NULL && pCur->data.getName() < dataIn.getName()) { pPre = pCur; pCur = pCur->next; } pPre->next = newNode; newNode->next = pCur; length++; } bool LinkedList::deleteNode(string target){ Node *pCur;
  • 2. Node *pPre; bool deleted = false; pPre = head; pCur = head->next; while (pCur != NULL && pCur->data.getName() < target) { pPre = pCur; pCur = pCur->next; } if (pCur != NULL && pCur->data.getName() == target) { pPre->next = pCur->next; delete pCur; deleted = true; length--; } return deleted; } void LinkedList::displayList() const{ Node *pCur; pCur = head->next; while (pCur) { cout << pCur->data; pCur = pCur->next; } cout << endl; } void LinkedList::displayList(int year) const {
  • 3. Node *pCur; pCur = head->next; int cnt = 0; while (pCur) { if (pCur->data.getYear() == year){ cout << pCur->data; cnt++; } pCur = pCur->next; } if (cnt == 0){ cout << "N/A" << endl; } } double LinkedList::average() const { double total = 0.0; double average; Node *pCur; pCur = head; while (pCur != NULL) { total += pCur->data.getAmount(); pCur = pCur->next; } average = total / static_cast(length); return average; } bool LinkedList::searchList(string find, Sales &dataOut) const {
  • 4. bool found = false; Node *pCur; pCur = head->next; while (pCur != NULL && pCur->data.getName() < find) { pCur = pCur->next; } if (pCur != NULL && pCur->data.getName() == find) { dataOut = pCur->data; found = true; } return found; } LinkedList::~LinkedList() { Node *pCur; Node *pNext; pCur = head->next; while(pCur != NULL) { pNext = pCur->next; delete pCur; pCur = pNext; } delete head; } main.cpp void buildList(const string &filename, LinkedList &list); void deleteManager(LinkedList &list); void searchManager(const LinkedList &list); void displayManager(const LinkedList &list); int main() { string inputFileName;
  • 5. LinkedList list; cout << "Enter file name: "; getline(cin, inputFileName); buildList(inputFileName, list); displayManager(list); searchManager(list); deleteManager(list); displayManager(list); return 0; } void buildList(const string &filename, LinkedList &list) { ifstream inFile(filename); cout <<"Reading data from "" << filename << ""n"; if(!inFile) { cout << "Error opening the input file: ""<< filename << """ << endl; exit(EXIT_FAILURE); } string id; int year; string name; int amount; string line; while (getline(inFile, line) ) { stringstream temp(line); temp >> id >> year; temp.ignore(); getline(temp, name, ';'); temp >> amount; // create a Sales object and initialize it with data from file Sales obj; obj.setId(id);
  • 6. obj.setYear(year); obj.setName(name); obj.setAmount(amount); // call insert to insert this new Sales object into the sorted list list.insertNode(obj); } inFile.close(); } void deleteManager(LinkedList &list) { string target = ""; cout << " Delete" << endl; cout << "========" << endl; while(target != "Q") { cout << "Enter a name (or Q to stop deleting):" << endl; getline(cin, target); target[0] = toupper(target[0]); if(target != "Q") { if(list.deleteNode(target)) cout << target << " has been deleted!" << endl; else cout << target << " not found!" << endl; } } cout << "___________________END DELETE SECTION_____" << endl; } void searchManager(const LinkedList &list) { string target = ""; Sales obj; cout << " Search" << endl; cout << "========" << endl;
  • 7. while (target != "Q") { cout << "Enter a name (or Q to stop searching):" << endl; getline(cin, target); target[0] = toupper(target[0]); if (target != "Q") { if (list.searchList(target, obj)) obj.display(); else cout << target << " not found!" << endl; } } cout << "___________________END SEARCH SECTION _____" << endl; } void displayManager(const LinkedList &list) { // Sub-functions of displayManager() void showMenu(void); string getOption(void); void showHeader(string line); string line = "==== ==================== =============n"; string option; showMenu(); option = getOption(); while(option[0] != 'Q') { switch (option[0]) { case 'A': showHeader(line); list.displayList(); cout << line; break; case 'G': cout << "Average (amount sold) $";
  • 8. cout << setprecision(2) << fixed; cout << list.average() << endl; break; case 'Y': int year; cout << "Enter year: " << endl; cin >> year; showHeader(line); list.displayList(year); cout << line; break; } option = getOption(); } cout << "Number of salespeople: " << list.getLength() << endl; } void showHeader(string line) { cout << line; cout << "Year" << " " << left << setw(20) << "Name" << " Amount Earned" << endl; cout << line; } string getOption(void) { string option; cout << "What is your option [A/G/Y/Q]?" << endl; cin >> option; cin.ignore(); option[0] = toupper(option[0]); while (option != "A" && option != "G" && option != "Y" && option != "Q") { cout << "Invalid Option: Try again!"; cout << "What is your option [A/G/Y/Q]?" << endl; cin >> option; cin.ignore();
  • 9. option[0] = toupper(option[0]); } return option; } void showMenu(void) { cout << "The following reports are available: " << endl; cout << "[A] - All" << endl << "[G] - Average" << endl << "[Y] - Year Hired" << endl << "[Q] - Quit" << endl; }
  翻译: