-
please I help me know
this code ,but
correct decleartion write yes or no
and int main() call funcion write or no
please correct in rong
Code:
#include<iostream>
Using namespace std;
Class percent
{
Percent();
Perecent(int the_value);
Friend istream& operator << (istream& ins,
perecent & the_object);
Friend istream& operator << (istream& ins,
perecent &a_ perecent );
Friend perecent & operator +(const perecent & p1,
Const percent & p2);
Friend perecent & operator _(const perecent & p1,
Const percent & p2);
Friend perecent & operator *(const perecent & p1,
Const percent & p2);
Private;
int value;
};
int main()
int value,y;
percent p1;
cout<<"enter the value ";
cin>>value>>y;
return 0;
}
Perecent:: Perecent()
{
Value=0;
Y=0;
}
Perecent::perecent(int the_value,int y)
{
Value=the_value;
Y=the_y}
Istream&operator>>(istream&ins,perent&the_object)
{
Ins>>value;
Ins>>y;
Return ins;
}
ostream&operator>>(ostream&ins,perent&the_object)
{
Outs<<value;
Outs<<y;
Return outs;
}
::perecent & operator +(const perecent & p1, perecent
Const percent & p2);
::perecent & operator _(const perecent & p1, perecent
Const percent & p2);
::perecent & operator *(const perecent & p1, perecent
Const percent & p2);
-
To start with, you have numerous capitalization and spelling errors.
-
-
Const -> const
Friend -> friend
perecent -> percent
operator _ -> operator -
Private; -> private:
Value -> value
Y -> y
and more
Kurt