Question

Question 16 You must put your data in classes if you use C++. True False 2...

Question 16

  1. You must put your data in classes if you use C++.

    True

    False

2 points

Question 17

  1. Constructors are automatically invoked during class instantiation.

    True

    False

2 points

Question 18

  1. To make your data accessible to entities outside of your class, declare the members of that class as private.

    True

    False

2 points

Question 19

  1. You can make arrays of built-in types like int and double, but not of user-defined types.

    True

    False

2 points

Question 20

  1. One class may contain many destructors.

    True

    False

2 points

Question 21

  1. One class can contain many constructors.

    True

    False

2 points

Question 22

  1. A pointer is basically a number that indicates a memory location.

    True

    False

2 points

Question 23

  1. Classes (objects), arrays, and the ability to create built-in data types exist in other OOP languages besides C++.

    True

    False

2 points

Question 24

  1. Trying to make an attribute (property) public is against the rules of C++ and therefore will cause a syntax error.

    True

    False

2 points

Question 25

  1. Which of the following is FALSE?

    A.

    A copy constructor will complete a deep copy of members by default.

    B.

    int ****y;

    is valid C++ code.

    C.

    vector<bool>*answers;

    is valid C++ code

    D.

    A node in a linked list includes a pointer to the next node in the list.

    E.

    bool *b=new bool[287];

    delete [] b;

    are valid lines of C++ code.

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

Answer 16: False, not always required
Answer 17: True
constructor will call when we create object

Answer 18:False,
we should declare as public
Answer 19:False
we can declare
Answer 20:False
we can have only one destructor
Answer 21: true
we can have any number of constructor
Answer 22: True
Answer 23: True
Answer 24: false
we can crate as public
Answer 25:A copy constructor will complete a deep copy of members by default.

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Question 16 You must put your data in classes if you use C++. True False 2...
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
  • Need to use C++ classes and each class will have 2 data members. We will provide...

    Need to use C++ classes and each class will have 2 data members. We will provide the code in main(), as well as a menu-driven "driver" section of code that will allow testing portions of your code separately, to give the option for partial credit.   Sample application areas are: class Movie: int year, char genre ('F' for fiction, 'N' for non-fiction) class Product: int price, char name ('I' for imported, 'L' for local) class Shape: int points, char name ('S'...

  • Question 22 4 pts In the statement: Int'. p and q are pointer variables. True False...

    Question 22 4 pts In the statement: Int'. p and q are pointer variables. True False D Question 23 4 pts If a user-defined class object that uses mathematical operators to pass to the template function, the class must contain code for the primitive data types the constructor the overloaded operators the try/catch blocks Question 24 4 pts Afriend function is a function that is not part of a class but has access to the class's private members as well...

  • 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 2 [5 points) State if each of the below statements is True or False 1...

    Question 2 [5 points) State if each of the below statements is True or False 1 2 3 The Compiler skips comments. A function can return a value of type array. An array index starts with 1. Pass by value is the default in CH, except when passing arrays as arguments to function The default storage class for local variables is static. A pointer provides an indirect means of accessing the value of a particular data item The logical operators...

  • C++ program, item.cpp implementation. Implementation: You are supposed to write three classes, called Item, Node and In...

    C++ program, item.cpp implementation. Implementation: You are supposed to write three classes, called Item, Node and Inventory respectively Item is a plain data class with item id, name, price and quantity information accompanied by getters and setters Node is a plain linked list node class with Item pointer and next pointer (with getters/setters) Inventory is an inventory database class that provides basic linked list operations, delete load from file / formatted print functionalities. The majority of implementation will be done...

  • C++ program, inventory.cpp implementation Mostly need the int load(istream&) function. Implementation: You are supp...

    C++ program, inventory.cpp implementation Mostly need the int load(istream&) function. Implementation: You are supposed to write three classes, called Item, Node and Inventory respectively Item is a plain data class with item id, name, price and quantity information accompanied by getters and setters Node is a plain linked list node class with Item pointer and next pointer (with getters/setters) Inventory is an inventory database class that provides basic linked list operations, delete load from file / formatted print functionalities. The...

  • C++ Implement a templated class list and listnode. You may add methods/functions as you see fit....

    C++ Implement a templated class list and listnode. You may add methods/functions as you see fit. Test these classes. I have left all of the implementation as an exercise for you. template< class NODETYPE > class List;  // forward declaration template<class NODETYPE> class ListNode {    friend class List< NODETYPE >; // make List a friend public:    ListNode( const NODETYPE &newData);  // copy constructor    NODETYPE getData() const;      // return data in the node private:    NODETYPE data;                 // data    ListNode< NODETYPE > *nextPtr; // next node...

  • My question is pretty simple, I just want to know how to call my operator== function...

    My question is pretty simple, I just want to know how to call my operator== function in Stack.cpp using a list function. Here is what I meant. This is my Stack.h file: class Stack { public:    /**constructors and destructors*/    Stack();    Stack(const Stack &S);    ~Stack();    void pop();    void push(int data);    bool operator==(const Stack &S); [ .......] private:    List<int> stack; }; Here is my List.h file: template<class listitem> class List { private:    struct...

  • C++ problem to use dynamic memory allocation (of arrays) and pointer manipulation in order to implement...

    C++ problem to use dynamic memory allocation (of arrays) and pointer manipulation in order to implement the Inner and Outer classes (Circular Buffer of circular buffers using Queues). No need of any classes from the Standard Template Library (STL), not even vector. Add the member functions of those classes by following the codes of InnerCB.h and CBofCB.h below: // file: InnerCB.h // Header file for Inner Circular Buffer. // See project description for details. // #ifndef _INNERCB_H_ #define _INNERCB_H_ class...

  • I have the following c++ data structures assignment: Copy Constructors, Destructors, and Assignment Operators An understanding...

    I have the following c++ data structures assignment: Copy Constructors, Destructors, and Assignment Operators An understanding of how to implement copy constructors, destructors, and assignment operators is essential when working with data structures using dynamic memory allocation. Failure to implement these methods correctly can and probably will result in memory leaks. In this project, you are provided with a working implementation of a doubly-linked list in which the copy constructor, destructor, and assignment operator methods are not complete. To complete...

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