Question: It is C++ programming Question 1 A___________ describes a data type. An_________ of a class is an object of the data type that exists in

It is C++ programming

Question 1

A___________ describes a data type. An_________ of a class is an object of the data type that exists in memory.

Question 2

A_______ is a member function that is automatically called when a class object is destroyed.

Question 3

________ files contain data that is unformatted and not necessarily stored as ASCII text.

Question 4

Using the code below, we can say, the difference between the struct Person and the class Person is the following.

All members of a struct are public by default. The members of a class, however, are private by default.

struct Person { string name; int age; }; class Person { string name; int age; }; 

True or False

Question 5

A(n) _______ is a function or class that is not a member of a class, but has access to private members of the class

Question 6

Making an instance of one classs a member of another class is called _______

Question 7

A______ is a member function that is automatically called when a class object is created.

Question 8

#include

#include

using namespace std;

class Foo {

int data;

public:

Foo(int data1){

data = data1;}

~Foo(){};

Foo(const Foo& rhs) {

data = rhs.data;}

int getData(void){

return data;}

};

int main() {

Foo foo(2);

cout << "Foo: "<

Foo foo2 = foo;

cout <<"Foo2: "<< foo2.getData() << endl;

Foo foo3(43);

foo=foo3;

cout << "Foo3: "<

cout << "Foo: "<

return = 0;

}

Given the code above,________ calls the copy constructor and __________ uses the assignment operator.

Question 9

All member variables should be public. True or False

Question 10

Which of the following is true?

A. Question 10 options:

B. Objects of a class do not share codes of non-static methods, they have their own copy

C. Objects of a class do not share non-static members. Every object has its own copy.

D. All objects of a class share all data members of class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!