Question: Question 11 The ______ member function reads raw binary data from a file. Question 12 In the class below, the keyword const ______________________________. class Rectangle

Question 11

The ______ member function reads "raw" binary data from a file.

Question 12

In the class below, the keyword const ______________________________.

class Rectangle { private: double width; double length; public: void setWidth(double); void setLength(double); double getWidth() const; double getLength() const; double getArea() const; }; 

A. specifies that the calling object must be of a void type

B. specifies that the function will not change any data stored in the calling object. However,it is okay if you inadvertently write code in the function that changes the calling object's data.

C. specifies that the return data type of the function will not change in the calling object.

D. specifies that the function will not change any data stored in the calling object.

Question 13

To________ a sequential-access file use the__________ member function to move the read position back to the beginning of the file.

Question 14

A private member function may be called from a statement outside the class, as long as the statement is in the same program as the class declaration.

True or Fakse

Question 15

In C++, _______ provide a convenient way to organize data into fields and records.

Question 16

Predict the output of following C++ program

#include

usingnamespacestd;

classEmpty {};

intmain()

{

cout <

return0;

}

A. Runtime error

B. A non-zero value

C. Complier error

D. 0

Question 17

A(n) _________ member function cannot access any nonstatic member variables in its own class.

Question 18

Using the code below, which statement is not an error

#include

using namespace std;

class Circle:

{

private

double centerX;

double centerY;

double radius;

public

setCenter(double, double);

setRadius(double);

}

A. expected class name -- remove the ":" after "Class"

B. expected ':' public

C. expected ':' at end of class

D. expected ':' after private

Question 19

The statements below explainsthe concept of_________________.

Each class object(an instance of a class) has its own copies of the class's instance variables. If a member variable is declared static, however, all instances of that class have access to that variable. If a member function is declared static, it may be called without any instances of the class being defined.

A. static members

B. instancemembers

C. instance and static members

Question 20

Given the code snippetbelow, what prints if the file hasonly one line, "Jayne Murphy"

file.open(fileName, ios::in);

if (file)

{

file.get(ch);

cout << ch;

//file.clear();

file.seekg(2l, ios::beg);

file.get(ch);

cout << ch;

file.close();

}

else

cout << fileName << " could not be opened. ";

Question 20 options:

A. "JM"

B. "JJ"

C. "Jy"

D. "Ja"

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!