CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    Join Date
    Aug 2005
    Posts
    16

    Re: can anyone help me

    I dont know

  2. #17
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: can anyone help me

    Quote Originally Posted by Mugilan
    I dont know
    Didn't your instructor cover strings in class? What implementation did he/she describe to you?

  3. #18
    Join Date
    May 2000
    Location
    NJ
    Posts
    640

    Re: can anyone help me

    Get a book for C++ beginners.

    It sounds like you never went to any of the classes. Nobody is going to do your homework for you. How are you suppose to learn if don't try to do it.

  4. #19
    Join Date
    Aug 2005
    Posts
    16

    Re: can anyone help me

    what is a default constructor ? how are an object's data members initialized if a class has only implicitly defined default constructor? explain the purpose of data member...........


    anyone can tell me.....where i can get answers for this....

  5. #20
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: can anyone help me

    Quote Originally Posted by Mugilan
    anyone can tell me.....where i can get answers for this....
    You normally learn that in the course. But it seems that you were playing truant. In that case I would take Jim's advice and get a book.
    Please don't forget to rate users who helped you!

  6. #21
    Join Date
    Aug 2005
    Posts
    16

    Re: can anyone help me

    i am not playing truant.........i am new to this...... i am taking diploma in IT, the class is just started about 2 weeks ago....

  7. #22
    Join Date
    Aug 2005
    Posts
    16

    Re: can anyone help me

    i write a program.......




    #include<iostream>
    using namespace std;

    class employee
    {
    string first;
    string last;
    int salary;

    public:
    void getdata(void);
    void setdata(void);

    employee()
    {
    salary = 0;
    last;
    first;
    }
    };
    int main()
    {
    void employee::getdata(void)
    {
    cout<<"a first name:";
    cout<<"a last name:";
    cout<<"monthly salary:";
    }

    void employee::setdata(void)
    {

    cout<<"first name";<< <<"\n";
    cout<<"last name";<< <<"\n";
    cout<<"monthly salary";<< <<"\n";
    }
    return 0;
    }


    but still got 2 error.......can anybody help me



    .cpp(24): error C2601: 'employee::getdata' : local function definitions are illegal

    .cpp(31): error C2601: 'employee::setdata' : local function definitions are illegal

  8. #23
    Join Date
    Jul 2005
    Location
    Germany
    Posts
    1,194

    Re: can anyone help me

    Quote Originally Posted by Mugilan
    void employee::getdata(void)
    {
    cout<<"a first name:";
    cout<<"a last name:";
    cout<<"monthly salary:";
    }

    void employee::setdata(void)
    {
    cout<<"first name";<< <<"\n";
    cout<<"last name";<< <<"\n";
    cout<<"monthly salary";<< <<"\n";
    }
    You have to put this (above) in the end. Out of the main() function.
    Please don't forget to rate users who helped you!

  9. #24
    Join Date
    Dec 2004
    Posts
    24

    Re: can anyone help me

    Google C++ tutorials.
    Read them slowly and carefully.
    Take your time.
    Understand what is data delcaration, functions, arrays and pointers.
    Then get on to OOPS concepts and classes.
    All the Best

  10. #25
    Join Date
    Aug 2005
    Posts
    16

    Re: can anyone help me

    #include<iostream>
    #include<string>
    using namespace std;

    class employee
    {
    string first;
    string last;
    int salary;


    public:
    void getdata(void);
    void setdata(void);

    employee()
    {
    salary = 0;
    last = " ";
    first = " ";

    }
    };

    void employee::getdata(void)
    {
    cout<<"\n a first name:"<<first;
    cout<<"\n a last name:"<<last;
    cout<<"\n monthly salary:"<<salary;

    }
    void employee::setdata(void)
    {
    cout<<"first name?:";
    cin>>first;
    cout<<"last name?:";
    cin>>last;
    cout<<"monthly salary?:";
    cin>>salary;

    }
    int main()
    {
    employee E;
    E.setdata();
    cout<<"\n yearly salary:\n";
    E.getdata();
    return 0;
    }



    using this program how to do this......create two employee objects and display each object's yearly salary.the give each employee a 10 percent raise and display each employee's yearly salary again.

  11. #26
    Join Date
    Aug 2005
    Posts
    16

    Unhappy Re: can anyone help me

    can anybody help me on this question.............................................


    wrte a program that prits the power of the integer 2, namely 2, 4, 8 , 16, 32, 64, etc. your while loop should not terminate (i.e..you should create an infinite loop). to do this simply use the keyword true as the expression for while statement. what happens when you ru this program?


    can anybody please help me on this

  12. #27
    Join Date
    Aug 2005
    Posts
    13

    Re: can anyone help me

    wt u want exactly????



    U want program ?

    OR


    wt happens if we run that program?

  13. #28
    Join Date
    Feb 2002
    Location
    Krispl, Austria
    Posts
    197

    Re: can anyone help me

    The whole idea of taking a diploma in IT is FOR YOU TO LEARN. Your instructor will have already covered what you need for this homework or will at least have given references to books. Pay attention, read the references and other supplied material and if you still don't understand tell him. We've already done our homework and can better spend our time helping others who show signs of helping themselves. You're showing absolutely no signs that you've made any effort at all. Why should we help?

    On a different point not related to this. I express the same views regarding the Indian sub-continent's request to do their IT outsourcing work for them.

    This is a forum for professionals and would-be profesionals. Not a "do my homework for me" and "write my outsourcing project for me" forum.

    I apologise in advance if I upset some members but this forum is cluttered with such requests and I'm getting a little tired of it (as I suspect are some other members).
    Requests such as
    "I need to write an new language compiler by next week, I have teach yourself c++ in 21 days, can someone give me example code?" will be ignored.

  14. #29
    Join Date
    Jun 2005
    Posts
    178

    Smile Re: can anyone help me

    Mugilan..what is ur age??
    do u go to school or college??



    we all will be very happy to see u urself doing ur home work..
    this site is to help someone who has a query..!!!

    Take it positively


    ProElite

  15. #30
    Join Date
    Aug 2005
    Posts
    16

    Unhappy Re: can anyone help me

    write a program

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured