Thread: please I help me know

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    9

    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);

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    To start with, you have numerous capitalization and spelling errors.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    9
    ok and what

  4. #4
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Const -> const
    Friend -> friend
    perecent -> percent
    operator _ -> operator -
    Private; -> private:
    Value -> value
    Y -> y
    and more
    Kurt

Popular pages Recent additions subscribe to a feed
Website Security Test