simple explanation of class needed

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Ok so i wrote this program based on a sample in my book for class (as you know Scott) but I am not quite sure why I did some of the things. Here is the class. What i dont understand is the part that says:
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
Polynomial(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &,
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &);
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext what am I saying here? I am preparing a class to accept 2 reference integers?
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext and then here:
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext Polynomial::Polynomial(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &firstcoef,
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &firstexpo)
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext {
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
coef = firstcoef;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
expo = firstexpo;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext }
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext

I am initializing the class saying it will accept 2 reference points pointing to firstcoef and firstexpo and then I initialize them in the class?

Thanks!

Jennifer



<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:blue class<span style="font-family:Courier New; color:windowtext Polynomial
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext {
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:blue public<span style="font-family:Courier New; color:windowtext :
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
Polynomial(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &,
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &);
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue void<span style="font-family:Courier New; color:windowtext setCoef(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &);
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext getCoef()
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext ;
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue void<span style="font-family:Courier New; color:windowtext setExpo(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &);
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext getExpo()
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext ;
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue void<span style="font-family:Courier New; color:windowtext print()
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext ;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue void<span style="font-family:Courier New; color:windowtext subtraction()
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext ;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue void<span style="font-family:Courier New; color:windowtext addition()
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext ;
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:blue private<span style="font-family:Courier New; color:windowtext :
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext coef;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext expo;
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext };
<p style="line-height:normal; margin:0in 0in 0pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext Polynomial::Polynomial(<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &firstcoef,
<span style="font-family:Courier New; color:blue const<span style="font-family:Courier New; color:windowtext
<span style="font-family:Courier New; color:blue int<span style="font-family:Courier New; color:windowtext &firstexpo)
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext {
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
coef = firstcoef;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext <span>
expo = firstexpo;
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Courier New; color:windowtext }

View the full article
 
Back
Top