Question

Question 1 10 pts Inheritance is a capability of C++ to represent increased specialization that is often found in real worldQuestion 4 10 pts The syntax for declaring DerivedClass to publicly inherit from BaseClass is given by class DerivedClass : pQuestion 6 10 pts The private data members of a base class are directly accessible by a derived class that privately inheritsQuestion 8 10 pts Protected member access, allows the class the member belongs to (base class) and also derived classes to ac

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER 1) True.

ANSWER 2) is-a relationship.

Inheritance (is-a) relationships are derived from child classes that inherit attributes and methods from their parent class. Composition (has-a) relationships are classes whose attributes are comprised of other classes.

ANSWER 3) True.

The Parent class is more of a general blueprint, which is the same for all its child classes. The child class properties are specific to only that class.

ANSWER 4) True.

ANSWER 5) No.

In the Base Class, there is no access specifier for int x and in C++ the default access specifier is Private thus it can not be accessed by its child class directly.

ANSWER 6) False.

When a class uses private member access specifiers to derive from a base, all public and protected members of the base class are accessible as private members of the derived class (private members of the base are never accessible unless friended).

ANSWER 7) Private > Protected > Public

ANSWER 8) True.

ANSWER 9) True.

When a class uses protected member access specifier to derive from a base, all public and protected members of the base class are accessible as protected members of the derived class (private members of the base are never accessible unless friended)

ANSWER 10) True.

Add a comment
Know the answer?
Add Answer to:
Question 1 10 pts Inheritance is a capability of C++ to represent increased specialization that is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For Question 14 - 15, please refer to the following code snippet. 1 class Fitness 2...

    For Question 14 - 15, please refer to the following code snippet. 1 class Fitness 2 { 3 int Jumping; int Running; 12 }; 8 class Round ISAShape: public class Fitness 9 { 10 11 int Sleeping; int Eating; 13 }; 14. The following statements are TRUE based on the code snippet above, EXCEPT (A) class RoundISAShape is inheriting from class Fitness (B) class RoundISAShape is the base class for class Fitness (C) class Round ISAShape is considered as the...

  • Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts...

    Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...

  • 14. Mark all that apply. Group of answer choices A child (derived) class will have access...

    14. Mark all that apply. Group of answer choices A child (derived) class will have access to its parent's protected and public members. Only public members are accessible by the objects of the class. A child (derived) class will have access to its parent's private, protected and public members. 15. Mark ALL statements that are TRUE. Group of answer choices When the list's head pointer points to nullptr , it means that the list is empty. The programmer must know...

  • Question 11     The feature that enables you to split source code between two or more...

    Question 11     The feature that enables you to split source code between two or more files is: Select one: a. base class b. partial classes c. generics d. dynamic link library e. package Question 12     Packaging data attributes and behaviors into a single unit so that the implementation details can be hidden describes an object-oriented feature called: Select one: a. abstraction b. objects c. inheritance d. polymorphism e. encapsulation Question 13     A multitier application would probably have:...

  • 27. Suppose the unary ! operator is an overloaded member function of class String. For a...

    27. Suppose the unary ! operator is an overloaded member function of class String. For a String object s, which function call is generated by the compiler when it finds the expression Is? a. s.operator!0 b. s.operator!(default valuel, default value?,...) c. operator!(s d. A compiler error results because no arguments are given 28. Select the false statement regarding inheritance. a. A derived class can contain more attributes and behaviors than its base class b. A derived class can be the...

  • D Question 18 4 pts A function template is an actual function that the compiler uses...

    D Question 18 4 pts A function template is an actual function that the compiler uses to generate one or more functions. True False D Question 19 4 pts Calls to methods use the class identifier instead of the object identifier as the method qualifier. constructor friend static this Question 20 4 pts If inheritance is private, all members of the base class, including private members, become private members of the derived class. True False Question 21 4 pts is...

  • D Question 6 4 pts Figure 1: clock Type |-hr: int -min: int -sec; int setTime...

    D Question 6 4 pts Figure 1: clock Type |-hr: int -min: int -sec; int setTime (int, int, int): void get Time (inte, int&, int&) const: void printTime() const: void increment seconds(): int +incrementMinutes(): int +increment Hours(): int -equalTime (const clockType.) const: bool Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many private members are in the class? none zero two three D Question 4 4 pts Consider the following class...

  • (1)     ____ is the principle that allows you to apply your knowledge of a general category...

    (1)     ____ is the principle that allows you to apply your knowledge of a general category to more specific objects.           a.       Inheritance              c.       Encapsulation           b.       Polymorphism                    d.       Override (2)     When you create a class by making it inherit from another class, you are provided with data fields and ____ automatically.           a.       fonts                      c.       class names           b.       methods                  d.       arrays (3)     By convention, a class diagram contains the ____ following each attribute or...

  • 4.a) 4.b> 4.c) C++ Programming Lab Exercise 09 Inheritance. Friend Functions, and Polymorphism (virtual functions) 4.a)...

    4.a) 4.b> 4.c) C++ Programming Lab Exercise 09 Inheritance. Friend Functions, and Polymorphism (virtual functions) 4.a) Run the following code and observe the output. #include <iostream> #include <string> using namespace std; class Vehicle public: void print() { cout << "Print: I am a vehicle. \n"; } void display() { cout << "Display: I am a vehicle. \n"; } }; class Car: public Vehicle { public: void print() { cout << "Print: I am a car.\n"; } void display() { cout...

  • At face value this class seems ok ... but really it's not... select all that are...

    At face value this class seems ok ... but really it's not... select all that are true public class Student private Personal Info information; public Personal Info getInfo() return this.information; This is just a standard getter ... nothing wrong with that. Returning the Personalinfo reference can open this Student to direct manipulation of their data. A more robust public interface should be created to protect and control access to Personalinfo information. This is technically encapsulated properly, but could have very...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT