-
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.
-
Some responses: Code:
http://cplusplus.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks