COP3330 Final - Myers Test 1 Actual Updated Questions And Answers, Exams of Medicine

COP3330 Final - Myers Test 1 Actual Updated Questions And Answers

Typology: Exams

2025/2026

Available from 01/13/2026

Ted.Bright
Ted.Bright ๐Ÿ‡บ๐Ÿ‡ธ

5

(1)

7.3K documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COP3330 Final - Myers Test 1 Actual Updated Questions And Answers
1.
which of the following statements is true regarding
classes and objects?
2.
which of the following is a conversion constructor for
a class called Prisoners? (assume Criminal is another
class)
member data of a class is
in scope inside its member
function definitions
Prisoner(Criminal x);
3.
which of the following would result in a compile stage
calling a function before it
error?
is declared
4.
in a class, the typical purpose of a destructor member
to do any final clean-up
function is...
5.
which of the following statements about operator
overloading is false?
tasks on an object before it
is deallocated
operator overloading can
be used to create new op-
erators
6.
which of the following describes an implementation of
an object of type Snow is
the composition(has-a) relationship?
declared as member data
of class Mountain
7.
if Tag is a class with a default constructor and a one-pa-
Tag list[] = {Tag(5),
rameter constructor (of type int), which of the follow-
ing is a valid declaration of an array of objects of type
Tag?
8.
which of the following is a valid operator prototype?
(Score is a class)
Tag(12), Tag()};
bool operator!=(const
Score&, const Score&);
9.
~Student();
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download COP3330 Final - Myers Test 1 Actual Updated Questions And Answers and more Exams Medicine in PDF only on Docsity!

COP3330 Final - Myers Test 1 Actual Updated Questions And Answers

  1. which of the following statements is true regarding classes and objects?
  2. which of the following is a conversion constructor for a class called Prisoners? (assume Criminal is another class) member data of a class is in scope inside its member function definitions Prisoner(Criminal x);
  3. which of the following would result in a compile stage calling a function before it error? is declared
  4. in a class, the typical purpose of a destructor member to do any final clean-up function is...
  5. which of the following statements about operator overloading is false? tasks on an object before it is deallocated operator overloading can be used to create new op- erators
  6. which of the following describes an implementation of an object of type Snow is the composition(has-a) relationship? declared as member data of class Mountain
  7. if Tag is a class with a default constructor and a one-pa- Tag list[] = {Tag(5), rameter constructor (of type int), which of the follow- ing is a valid declaration of an array of objects of type Tag?
  8. which of the following is a valid operator prototype? (Score is a class) Tag(12), Tag()}; bool operator!=(const Score&, const Score&);
  9. ~Student();

which of the following is a valid member function that is guaranteed to run last for an object of class type Student?

  1. which of the following is a correct way to declare a member function of a class so that it will be guar- enteed to not change the member data of the calling object? int Compute(int &x) const;
  2. T/F: if a binary operator is overloaded and written as a true stand-alone function, the function takes two parame- ters
  3. T/F: if an array of Fraction objects is declared to be size 10, but is only storing 7 Fractions, this should be denoted by putting a null character '/0' at the end false
  4. T/F: the command "g++ - c circle.cpp" invokes the com- true pile stage but not the linking stage of the compilation process
  5. T/F: an l-value is an expression that represents a mod- true ifiable and non-temporary storage location
  6. T/F: if a member data variable of a class is declared to be static, its value can differ for separate objects of that class type
  7. T/F: a friend of a class has access only to the public section of that class false false
  8. T/F: function calls are checked against their prototypes false for correctness during the linking stage of a program build

void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created. LEGAL OR ILLEGAL: Link n1;

  1. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created.

LEGAL

LEGAL OR ILLEGAL:

int a = x.counter;

  1. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created. LEGAL OR ILLEGAL: const Link t('Q');
  2. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum();

LEGAL

ILLEGAL

explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created. LEGAL OR ILLEGAL: x.Change('A');

  1. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created.

ILLEGAL

LEGAL OR ILLEGAL:

y.CheckSum();

  1. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private: void CheckSum(); double value; }; Assume the following lines of code are attempted in a main() program. Also assume that the object x and y are of type Link and have been properly created. LEGAL OR ILLEGAL: y.Verify(1.23);
  2. class Link{ public: Link(char n = 'a'); explicit Link(double z); void Change(const Link& b); void Verify(double& val) const; int counter; private:

ILLEGAL

LEGAL