Results 1 to 2 of 2

Thread: exercise using c + +

  1. #1
    Join Date
    May 2009
    Posts
    81
    Rep Power
    4

    Default exercise using c + +

    Hello,

    As part of learning the basics of C + +, I try to answer the following problem, which does not present particular difficulties but I think I am a novice and it is not easy at first.
    Could you please some answers to bring?
    Thank you in advance!

    Let the class C + + follows:
    ] Class Content
    (
    Public: int x;
    int y;
    Content () () / / the contents of functions has not been defined and therefore can not / / be considered a syntax error
    int Execute () ();
    void Print () () *
    );


    Questions:
    1 - This class you seem syntactically correct it?
    2 - The concept of encapsulation under C + + is - she presents in this class? Explain in 2 cases (or not) your response. In cases where no encapsulation in this class, proposing the implementation of this concept in this class.
    3 - This Can be a base class in the case of inheritance? Justify your answer. Reply or not simply will not constitute valid response.
    4 - What is the meaning polymorphism C + +?
    5 - What are two cases where the concept of polymorphism is used in C + +.
    6 - For this class is an abstract class, what should it contain? This concept has implications for its use. Quote by-at least 2.
    7 - Modify the class so that it can accept all data types (char, int, float, double, pointer, ...). Imagine this version in the classroom, a case of application by setting all members. Each member represents your vision of a salary he can do. Create objects of this class in all cases (data type proposed above). In a main () for example.

  2. #2
    David Gower is offline Member
    Join Date
    May 2009
    Posts
    75
    Rep Power
    4

    Default

    Some responses:
    Code:
    http://cplusplus.com

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48