SlideShare a Scribd company logo
1 of 2
Download to read offline
/***********parameterized constructor**************/
PlnArray::PlnArray(double coeffArray[], int arraysize) { // parametrized constructor
n = arraysize-1;//because highest degree of size will have degree less then 1 e.g. 8
will have degree 7
coeff = coeffArray; // copy array to pointer through parametrized constructor
}
/************copy constructor***************/
PlnArray::PlnArray(const PlnArray& pln) { // copy constructor
n=pln.n;
coeff=new double[n];
coeff = pln.coeff; // assignng array by copy constructor
}
/**********destructor**************/
PlnArray::~PlnArray(){
//Release the memory allocated
delete coeff;
}
Thanks a lot. If you have any doubt feel free to ask
Solution
/***********parameterized constructor**************/
PlnArray::PlnArray(double coeffArray[], int arraysize) { // parametrized constructor
n = arraysize-1;//because highest degree of size will have degree less then 1 e.g. 8
will have degree 7
coeff = coeffArray; // copy array to pointer through parametrized constructor
}
/************copy constructor***************/
PlnArray::PlnArray(const PlnArray& pln) { // copy constructor
n=pln.n;
coeff=new double[n];
coeff = pln.coeff; // assignng array by copy constructor
}
/**********destructor**************/
PlnArray::~PlnArray(){
//Release the memory allocated
delete coeff;
}
Thanks a lot. If you have any doubt feel free to ask

More Related Content

Similar to parameterized constructorPlnArrayPlnA.pdf

Were writing code for a project that dynamically allocates an arra.pdf
Were writing code for a project that dynamically allocates an arra.pdfWere writing code for a project that dynamically allocates an arra.pdf
Were writing code for a project that dynamically allocates an arra.pdf
fsenterprises
 
Complete in JavaCardApp.javapublic class CardApp { private.pdf
Complete in JavaCardApp.javapublic class CardApp {   private.pdfComplete in JavaCardApp.javapublic class CardApp {   private.pdf
Complete in JavaCardApp.javapublic class CardApp { private.pdf
MAYANKBANSAL1981
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdf
jyothimuppasani1
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
aquadreammail
 
Lab11.cppLab11.cpp.docx
Lab11.cppLab11.cpp.docxLab11.cppLab11.cpp.docx
Lab11.cppLab11.cpp.docx
DIPESH30
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
ARCHANASTOREKOTA
 
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdfQ1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
abdulrahamanbags
 
When we test your Fraction.java we will use the given FractionTester.pdf
When we test your Fraction.java we will use the given FractionTester.pdfWhen we test your Fraction.java we will use the given FractionTester.pdf
When we test your Fraction.java we will use the given FractionTester.pdf
arihantkitchenmart
 
In this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdfIn this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdf
contact41
 
Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
Tech_MX
 
Lab08Lab08.cppLab08Lab08.cpp.docx
Lab08Lab08.cppLab08Lab08.cpp.docxLab08Lab08.cppLab08Lab08.cpp.docx
Lab08Lab08.cppLab08Lab08.cpp.docx
DIPESH30
 
#include deck.h .pdf
#include deck.h .pdf#include deck.h .pdf
#include deck.h .pdf
agarvalcollections16
 
WHAT TO DOUpdate the comment boxes at the top of each function in.pdf
WHAT TO DOUpdate the comment boxes at the top of each function in.pdfWHAT TO DOUpdate the comment boxes at the top of each function in.pdf
WHAT TO DOUpdate the comment boxes at the top of each function in.pdf
adityavision1
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
Adamq0DJonese
 

Similar to parameterized constructorPlnArrayPlnA.pdf (20)

Were writing code for a project that dynamically allocates an arra.pdf
Were writing code for a project that dynamically allocates an arra.pdfWere writing code for a project that dynamically allocates an arra.pdf
Were writing code for a project that dynamically allocates an arra.pdf
 
Object oriented programming; operator overloading array
Object oriented programming; operator overloading arrayObject oriented programming; operator overloading array
Object oriented programming; operator overloading array
 
Complete in JavaCardApp.javapublic class CardApp { private.pdf
Complete in JavaCardApp.javapublic class CardApp {   private.pdfComplete in JavaCardApp.javapublic class CardApp {   private.pdf
Complete in JavaCardApp.javapublic class CardApp { private.pdf
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdf
 
C++_notes.pdf
C++_notes.pdfC++_notes.pdf
C++_notes.pdf
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
 
Lab11.cppLab11.cpp.docx
Lab11.cppLab11.cpp.docxLab11.cppLab11.cpp.docx
Lab11.cppLab11.cpp.docx
 
StackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdfStackInterface An interface for the ADT stack. Do not modif.pdf
StackInterface An interface for the ADT stack. Do not modif.pdf
 
Advance C++notes
Advance C++notesAdvance C++notes
Advance C++notes
 
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdfQ1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
Q1 Consider the below omp_trap1.c implantation, modify the code so t.pdf
 
When we test your Fraction.java we will use the given FractionTester.pdf
When we test your Fraction.java we will use the given FractionTester.pdfWhen we test your Fraction.java we will use the given FractionTester.pdf
When we test your Fraction.java we will use the given FractionTester.pdf
 
Academy PRO: ES2015
Academy PRO: ES2015Academy PRO: ES2015
Academy PRO: ES2015
 
In this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdfIn this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdf
 
Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
 
Lab08Lab08.cppLab08Lab08.cpp.docx
Lab08Lab08.cppLab08Lab08.cpp.docxLab08Lab08.cppLab08Lab08.cpp.docx
Lab08Lab08.cppLab08Lab08.cpp.docx
 
#include deck.h .pdf
#include deck.h .pdf#include deck.h .pdf
#include deck.h .pdf
 
Lecture5
Lecture5Lecture5
Lecture5
 
WHAT TO DOUpdate the comment boxes at the top of each function in.pdf
WHAT TO DOUpdate the comment boxes at the top of each function in.pdfWHAT TO DOUpdate the comment boxes at the top of each function in.pdf
WHAT TO DOUpdate the comment boxes at the top of each function in.pdf
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 

More from preetajain

x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdfx = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
preetajain
 
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdfThere are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
preetajain
 
The difference between these two types of inflation is found in thei.pdf
The difference between these two types of inflation is found in thei.pdfThe difference between these two types of inflation is found in thei.pdf
The difference between these two types of inflation is found in thei.pdf
preetajain
 
The Federal Reserve is not a part of U.S. Government. It operates on.pdf
The Federal Reserve is not a part of U.S. Government. It operates on.pdfThe Federal Reserve is not a part of U.S. Government. It operates on.pdf
The Federal Reserve is not a part of U.S. Government. It operates on.pdf
preetajain
 
The correct answer is InductionInduction is the process in which .pdf
The correct answer is InductionInduction is the process in which .pdfThe correct answer is InductionInduction is the process in which .pdf
The correct answer is InductionInduction is the process in which .pdf
preetajain
 
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdfQ.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
preetajain
 

More from preetajain (20)

Reject the null hypothesis.Solution Reject the null hypothesi.pdf
 Reject the null hypothesis.Solution Reject the null hypothesi.pdf Reject the null hypothesis.Solution Reject the null hypothesi.pdf
Reject the null hypothesis.Solution Reject the null hypothesi.pdf
 
Baking powder usually consists of a solid acid and a base. For examp.pdf
  Baking powder usually consists of a solid acid and a base. For examp.pdf  Baking powder usually consists of a solid acid and a base. For examp.pdf
Baking powder usually consists of a solid acid and a base. For examp.pdf
 
They basically provide an alternative path for th.pdf
                     They basically provide an alternative path for th.pdf                     They basically provide an alternative path for th.pdf
They basically provide an alternative path for th.pdf
 
OH- is the reacting species and Ba2+ is the spect.pdf
                     OH- is the reacting species and Ba2+ is the spect.pdf                     OH- is the reacting species and Ba2+ is the spect.pdf
OH- is the reacting species and Ba2+ is the spect.pdf
 
molarity = molesvolume = 24 = 0.5 .pdf
                     molarity = molesvolume = 24 = 0.5              .pdf                     molarity = molesvolume = 24 = 0.5              .pdf
molarity = molesvolume = 24 = 0.5 .pdf
 
find a common denominator for the subscripts (CH2.pdf
                     find a common denominator for the subscripts (CH2.pdf                     find a common denominator for the subscripts (CH2.pdf
find a common denominator for the subscripts (CH2.pdf
 
Due to resonance the N-O bond lengths in NO3 - ar.pdf
                     Due to resonance the N-O bond lengths in NO3 - ar.pdf                     Due to resonance the N-O bond lengths in NO3 - ar.pdf
Due to resonance the N-O bond lengths in NO3 - ar.pdf
 
Yaws- tropical infection of skin and joints etc.Spread by direct con.pdf
Yaws- tropical infection of skin and joints etc.Spread by direct con.pdfYaws- tropical infection of skin and joints etc.Spread by direct con.pdf
Yaws- tropical infection of skin and joints etc.Spread by direct con.pdf
 
x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdfx = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
x = 0.3, and y0 = 0so, interval ==[0,0.3]step soize = h = 0.1.pdf
 
CCl4 All the have ionic bonds. Carbon and Chlori.pdf
                     CCl4  All the have ionic bonds. Carbon and Chlori.pdf                     CCl4  All the have ionic bonds. Carbon and Chlori.pdf
CCl4 All the have ionic bonds. Carbon and Chlori.pdf
 
Let x moles of CF4 be formed at equilibrium. Hence at equilibrium mo.pdf
Let x moles of CF4 be formed at equilibrium. Hence at equilibrium mo.pdfLet x moles of CF4 be formed at equilibrium. Hence at equilibrium mo.pdf
Let x moles of CF4 be formed at equilibrium. Hence at equilibrium mo.pdf
 
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdfThere are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
There are two types of diabetes Diabetes Insipidus and Diabetes mel.pdf
 
The difference between these two types of inflation is found in thei.pdf
The difference between these two types of inflation is found in thei.pdfThe difference between these two types of inflation is found in thei.pdf
The difference between these two types of inflation is found in thei.pdf
 
The Federal Reserve is not a part of U.S. Government. It operates on.pdf
The Federal Reserve is not a part of U.S. Government. It operates on.pdfThe Federal Reserve is not a part of U.S. Government. It operates on.pdf
The Federal Reserve is not a part of U.S. Government. It operates on.pdf
 
The correct answer is InductionInduction is the process in which .pdf
The correct answer is InductionInduction is the process in which .pdfThe correct answer is InductionInduction is the process in which .pdf
The correct answer is InductionInduction is the process in which .pdf
 
Step1 Reverse the 2nd equation and add to the first equation Ste.pdf
Step1 Reverse the 2nd equation and add to the first equation Ste.pdfStep1 Reverse the 2nd equation and add to the first equation Ste.pdf
Step1 Reverse the 2nd equation and add to the first equation Ste.pdf
 
RNA polymerase II help in repair by protecting DNA damaged by formin.pdf
RNA polymerase II help in repair by protecting DNA damaged by formin.pdfRNA polymerase II help in repair by protecting DNA damaged by formin.pdf
RNA polymerase II help in repair by protecting DNA damaged by formin.pdf
 
prepaid expenses are devided by Total Assets.Solutionprepaid e.pdf
prepaid expenses are devided by Total Assets.Solutionprepaid e.pdfprepaid expenses are devided by Total Assets.Solutionprepaid e.pdf
prepaid expenses are devided by Total Assets.Solutionprepaid e.pdf
 
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdfQ.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
Q.1) The Hardware Layer-The hardware layer is sometimes referred t.pdf
 
NO2^- involves 2 bonds (one is N-O single bond, the other is N=O dou.pdf
NO2^- involves 2 bonds (one is N-O single bond, the other is N=O dou.pdfNO2^- involves 2 bonds (one is N-O single bond, the other is N=O dou.pdf
NO2^- involves 2 bonds (one is N-O single bond, the other is N=O dou.pdf
 

Recently uploaded

Recently uploaded (20)

Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

parameterized constructorPlnArrayPlnA.pdf

  • 1. /***********parameterized constructor**************/ PlnArray::PlnArray(double coeffArray[], int arraysize) { // parametrized constructor n = arraysize-1;//because highest degree of size will have degree less then 1 e.g. 8 will have degree 7 coeff = coeffArray; // copy array to pointer through parametrized constructor } /************copy constructor***************/ PlnArray::PlnArray(const PlnArray& pln) { // copy constructor n=pln.n; coeff=new double[n]; coeff = pln.coeff; // assignng array by copy constructor } /**********destructor**************/ PlnArray::~PlnArray(){ //Release the memory allocated delete coeff; } Thanks a lot. If you have any doubt feel free to ask Solution /***********parameterized constructor**************/ PlnArray::PlnArray(double coeffArray[], int arraysize) { // parametrized constructor n = arraysize-1;//because highest degree of size will have degree less then 1 e.g. 8 will have degree 7 coeff = coeffArray; // copy array to pointer through parametrized constructor } /************copy constructor***************/ PlnArray::PlnArray(const PlnArray& pln) { // copy constructor n=pln.n; coeff=new double[n]; coeff = pln.coeff; // assignng array by copy constructor }
  • 2. /**********destructor**************/ PlnArray::~PlnArray(){ //Release the memory allocated delete coeff; } Thanks a lot. If you have any doubt feel free to ask