Question

C++ True or False (True → CAN be accessed, False → CANNOT be accessed) A public variable declared in class ABC CAN be accesse

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

Part A:

a)True

b)True

c)False, as the friend class has access to the private & protected members

d)False, as only private & protected members are accessed

e)False,as only private & protected members are accessed

f)False, It should be accessed without the (.) dot operator

Part B:

g)True

h)True

i)True

j)True

k)True

l)False, It should be accessed without the (.) dot operator

Part C:

m)True

n)False,private members are not inherited

o)True

p)True

q)False

r)False, It should be accessed without the (.) dot operator

Add a comment
Know the answer?
Add Answer to:
C++ True or False (True → CAN be accessed, False → CANNOT be accessed) A public...
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
  • Which access modifier is used to ensure that a variable can only be accessed within the...

    Which access modifier is used to ensure that a variable can only be accessed within the class where the variable is declared? Private O Public O Protected Friend In requirement specification or requirement engineering, functional requirements . o should be complete and consistent O should be precise and concise o include domain requirements O plan the solution to the problems identified in the software analysis stage Which of the following statements is NOT true about a parameterized query? o it...

  • Question 1 10 pts Inheritance is a capability of C++ to represent increased specialization that is...

    Question 1 10 pts Inheritance is a capability of C++ to represent increased specialization that is often found in real world relationships. True False Question 2 10 pts Inheritance between a child and parent object exhibits an 'relationship. Question 3 10 pts As you move down an inheritance relationship from parent to child, you typically move from a general to specific description. True False Question 4 10 pts The syntax for declaring DerivedClass to publicly inherit from BaseClass is given...

  • 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...

  • True /False 13. _There is only one copy of the class's member func- tions and that...

    True /False 13. _There is only one copy of the class's member func- tions and that copy is shared among all the class's objects 14. Putting class definition in a separate file (e-g. head- er) makes it easy to reuse. 15. _A private data member of a class can usually be accessed from outside the class. 16. A member function of a class can call other private member functions of the same class. 17. _A destructor function can have parameters....

  • 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...

  • For the following code, which statement is not true? Class Point {     private:         double...

    For the following code, which statement is not true? Class Point {     private:         double y;         double z;     public:         double x; }; a.z is available to objects of type Point declared outside the class. b.x is available to objects of type Point declared outside the class. c.x, y, and z are called members variables of the class. d.The name of the class is Point. Given the code below, What is the most accurate description of AwesomeClass(AwesomeClass...

  • 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...

  • Multiple Choice Multiple Choice Section 2.1 - 2.2 Introduction to Classes Here is the start of...

    Multiple Choice Multiple Choice Section 2.1 - 2.2 Introduction to Classes Here is the start of a class declaration: class foo { public: void x(foo f); void y(const foo f); void z(foo f) const; ... Which of the three member functions can alter the PRIVATE member variables of the foo object that activates the function? A. Only x can alter the private member variables of the object that activates the function. B. Only y can alter the private member variables...

  • Create a class called Skateboard. Skateboard has 3 private member variables and 3 public member functions.(C++,...

    Create a class called Skateboard. Skateboard has 3 private member variables and 3 public member functions.(C++, Visual Studios) Skateboard has the following 3 private member variables: 1) the brand of the skateboard (such as “Sector 9”)       2) the model of the skateboard (such as “Hot Steppa”) 3) the length of the skateboard in inches (such as “22”) Skateboard has the following 3 public member functions: a member function named print which does not have any return value or input...

  • C++ please 27. How do you differentiate a destructor from the rest? 28. Can a static...

    C++ please 27. How do you differentiate a destructor from the rest? 28. Can a static function call an instance one? 29. Can an instance function call a static one? 30. How many objects are created? class Account { public: string firstName; string lastName; double balance; Account* p; 31. Discuss the differences among the following access modifiers, public, private, and protected. 32. When do you use the following notation? . (dot notation) :: (scope resolution operator) -> (arrow notation) 33....

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