SlideShare a Scribd company logo
1 of 2
Download to read offline
Do the following pic:
Solution
Here is the solution for the first 2 problems in the pic:
#include
using namespace std;
template
class Dec
{
public:
//hasDuplicate function that returns true if the private data member has an item that appears
twice or more in the list.
bool hasDuplicate();
//eraseAll function to remove all items which are equal to the item specified in the function
parameter.
void eraseAll(ElementType element);
//isLessThan function to determine if another Dec object is greater than the Dec object itself.
//If the summation of all items from the Dec object itself is less than the summation of all
//items from another Dec object, return true, otherwise, return false.
bool isLessThan(Dec other);
//push_second function to add an item after the first item if there are more than one items.
void push_second(ElementType element);
private:
vector dec;
};
template
bool Dec::hasDuplicate()
{
for(vector::iterator ot = dec.begin(); ot != dec.end(); ot++)
for(vector::iterator it = dec.begin() + ot + 1; it != dec.end(); it++)
if(*it == *ot)
return true;
return false;
}
template
bool Dec::isLessThan(Dec other)
{
int sum1 = 0, sum2 = 0;
for(vector::iterator it = dec.begin(); it != dec.end(); it++)
sum1 += *it;
for(vector::iterator it = other.dec.begin(); it != other.dec.end(); it++)
sum2 += *it;
return sum1 < sum2;
}

More Related Content

Similar to Do the following picSolutionHere is the solution for the .pdf

PriorityQueue.cs Jim Mischel using System; using Sy.pdf
 PriorityQueue.cs   Jim Mischel using System; using Sy.pdf PriorityQueue.cs   Jim Mischel using System; using Sy.pdf
PriorityQueue.cs Jim Mischel using System; using Sy.pdfrajat630669
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionVisual Engineering
 
public class DoubleArraySeq implements Cloneable {    Priva.pdf
public class DoubleArraySeq implements Cloneable {     Priva.pdfpublic class DoubleArraySeq implements Cloneable {     Priva.pdf
public class DoubleArraySeq implements Cloneable {    Priva.pdfannaimobiles
 
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docx
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docxAdd functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docx
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docxWilliamZnlMarshallc
 
This is problem is same problem which i submitted on 22017, I just.pdf
This is problem is same problem which i submitted on 22017, I just.pdfThis is problem is same problem which i submitted on 22017, I just.pdf
This is problem is same problem which i submitted on 22017, I just.pdffcaindore
 
In java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdfIn java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdfaromalcom
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfmallik3000
 
You are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxYou are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxJonathan5GxRossk
 
I am sorry but my major does not cover programming in depth (ICT) an.pdf
I am sorry but my major does not cover programming in depth (ICT) an.pdfI am sorry but my major does not cover programming in depth (ICT) an.pdf
I am sorry but my major does not cover programming in depth (ICT) an.pdfseamusschwaabl99557
 
STAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdfSTAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdfbabitasingh698417
 
(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manualChandrapriya Jayabal
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfarpitaeron555
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfinfo430661
 
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docx
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docxMod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docx
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docxJason0x0Scottw
 
4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdfmumnesh
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesKaniska Mandal
 
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfAnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfnipuns1983
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdffashiongallery1
 

Similar to Do the following picSolutionHere is the solution for the .pdf (20)

PriorityQueue.cs Jim Mischel using System; using Sy.pdf
 PriorityQueue.cs   Jim Mischel using System; using Sy.pdf PriorityQueue.cs   Jim Mischel using System; using Sy.pdf
PriorityQueue.cs Jim Mischel using System; using Sy.pdf
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
 
public class DoubleArraySeq implements Cloneable {    Priva.pdf
public class DoubleArraySeq implements Cloneable {     Priva.pdfpublic class DoubleArraySeq implements Cloneable {     Priva.pdf
public class DoubleArraySeq implements Cloneable {    Priva.pdf
 
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docx
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docxAdd functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docx
Add functions push(int n- Deque &dq) and pop(Deque &dq)- Functions pus.docx
 
final project for C#
final project for C#final project for C#
final project for C#
 
This is problem is same problem which i submitted on 22017, I just.pdf
This is problem is same problem which i submitted on 22017, I just.pdfThis is problem is same problem which i submitted on 22017, I just.pdf
This is problem is same problem which i submitted on 22017, I just.pdf
 
In java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdfIn java , I want you to implement a Data Structure known as a Doubly.pdf
In java , I want you to implement a Data Structure known as a Doubly.pdf
 
Using the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdfUsing the C++ programming language1. Implement the UnsortedList cl.pdf
Using the C++ programming language1. Implement the UnsortedList cl.pdf
 
You are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docxYou are required to implement the following functions for doubly linke.docx
You are required to implement the following functions for doubly linke.docx
 
I am sorry but my major does not cover programming in depth (ICT) an.pdf
I am sorry but my major does not cover programming in depth (ICT) an.pdfI am sorry but my major does not cover programming in depth (ICT) an.pdf
I am sorry but my major does not cover programming in depth (ICT) an.pdf
 
STAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdfSTAGE 2 The Methods 65 points Implement all the methods t.pdf
STAGE 2 The Methods 65 points Implement all the methods t.pdf
 
(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual(674335607) cs2309 java-lab-manual
(674335607) cs2309 java-lab-manual
 
Introduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdfIntroduction and BackgroundIn recent lectures we discussed usi.pdf
Introduction and BackgroundIn recent lectures we discussed usi.pdf
 
Given below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdfGiven below is the completed implementation of MyLinkedList class. O.pdf
Given below is the completed implementation of MyLinkedList class. O.pdf
 
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docx
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docxMod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docx
Mod 4 Homeork Enhanced DoublyLinkedList Starter Code- # Do not modify.docx
 
4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf4. The size of instructions can be fixed or variable. What are advant.pdf
4. The size of instructions can be fixed or variable. What are advant.pdf
 
Converting Db Schema Into Uml Classes
Converting Db Schema Into Uml ClassesConverting Db Schema Into Uml Classes
Converting Db Schema Into Uml Classes
 
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdfAnswerNote Driver class is not given to test the DoubleArraySeq..pdf
AnswerNote Driver class is not given to test the DoubleArraySeq..pdf
 
For this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdfFor this lab you will complete the class MyArrayList by implementing.pdf
For this lab you will complete the class MyArrayList by implementing.pdf
 
DOM and Events
DOM and EventsDOM and Events
DOM and Events
 

More from dhavalbl38

Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfImagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfdhavalbl38
 
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfIf a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfdhavalbl38
 
Help with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfHelp with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfdhavalbl38
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfdhavalbl38
 
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfEmperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfdhavalbl38
 
Even before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfEven before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfdhavalbl38
 
Can one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfCan one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfdhavalbl38
 
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfwhy is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfdhavalbl38
 
Which of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfWhich of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfdhavalbl38
 
What is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfWhat is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfdhavalbl38
 
what are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfwhat are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfdhavalbl38
 
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfWACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfdhavalbl38
 
Two particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfTwo particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfdhavalbl38
 
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
The forecast equation for mean wind in a turbulent flow is  U_it + .pdfThe forecast equation for mean wind in a turbulent flow is  U_it + .pdf
The forecast equation for mean wind in a turbulent flow is U_it + .pdfdhavalbl38
 
The image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfThe image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfdhavalbl38
 
The concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfThe concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfdhavalbl38
 
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfThe diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfdhavalbl38
 
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfaed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfdhavalbl38
 
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdft t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdfdhavalbl38
 
Actual costs are determined by plugging the actual level of activity.pdf
Actual costs are determined by plugging the actual level of activity.pdfActual costs are determined by plugging the actual level of activity.pdf
Actual costs are determined by plugging the actual level of activity.pdfdhavalbl38
 

More from dhavalbl38 (20)

Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfImagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
 
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfIf a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
 
Help with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfHelp with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdf
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdf
 
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfEmperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
 
Even before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfEven before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdf
 
Can one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfCan one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdf
 
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfwhy is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
 
Which of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfWhich of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdf
 
What is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfWhat is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdf
 
what are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfwhat are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdf
 
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfWACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
 
Two particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfTwo particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdf
 
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
The forecast equation for mean wind in a turbulent flow is  U_it + .pdfThe forecast equation for mean wind in a turbulent flow is  U_it + .pdf
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
 
The image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfThe image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdf
 
The concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfThe concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdf
 
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfThe diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
 
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfaed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
 
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdft t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
 
Actual costs are determined by plugging the actual level of activity.pdf
Actual costs are determined by plugging the actual level of activity.pdfActual costs are determined by plugging the actual level of activity.pdf
Actual costs are determined by plugging the actual level of activity.pdf
 

Recently uploaded

PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesAmanpreetKaur157993
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 

Recently uploaded (20)

PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 

Do the following picSolutionHere is the solution for the .pdf

  • 1. Do the following pic: Solution Here is the solution for the first 2 problems in the pic: #include using namespace std; template class Dec { public: //hasDuplicate function that returns true if the private data member has an item that appears twice or more in the list. bool hasDuplicate(); //eraseAll function to remove all items which are equal to the item specified in the function parameter. void eraseAll(ElementType element); //isLessThan function to determine if another Dec object is greater than the Dec object itself. //If the summation of all items from the Dec object itself is less than the summation of all //items from another Dec object, return true, otherwise, return false. bool isLessThan(Dec other); //push_second function to add an item after the first item if there are more than one items. void push_second(ElementType element); private: vector dec; }; template bool Dec::hasDuplicate() { for(vector::iterator ot = dec.begin(); ot != dec.end(); ot++) for(vector::iterator it = dec.begin() + ot + 1; it != dec.end(); it++) if(*it == *ot) return true;
  • 2. return false; } template bool Dec::isLessThan(Dec other) { int sum1 = 0, sum2 = 0; for(vector::iterator it = dec.begin(); it != dec.end(); it++) sum1 += *it; for(vector::iterator it = other.dec.begin(); it != other.dec.end(); it++) sum2 += *it; return sum1 < sum2; }