100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COP 3330 FSU Exam 2 Study Guide with Complete Solutions

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
12-12-2025
Written in
2025/2026

COP 3330 FSU Exam 2 Study Guide with Complete Solutions

Institution
COP 3330
Course
COP 3330










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
COP 3330
Course
COP 3330

Document information

Uploaded on
December 12, 2025
Number of pages
17
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COP 3330 FSU Exam 2 Study Guide
with Complete Solutions
A class constructor

a) may have any number of parameters

b) must be supplied explicitly for each class

c) is a method that is called automatically when an object is created

d) is used to ensure that an object's resources are properly allocated when it comes into
scope

e) is used by an IDE (such as Visual C++) to assist in editing a class

f) will be supplied automatically if none is supplied by the programmer

g) will be used to make sure resources are de-allocated when an object goes out of
scope

h) may be used to build the class - ANSWER-may have any number of parameters
is a method that is called automatically when an object is created
is used to ensure that an object's resources are properly allocated when it comes into
scope
will be supplied automatically if none is supplied by the programme

A class destructor

a. may have any number of parameters

b. must be paired with each constructor for the class

c. is responsible for de-allocating resources when an object goes out of scope

d. is called multiple times by operator delete []

e. is called by operator new

f. is called by operator delete

g. will be created automatically if none is supplied by the programmer

,h. must be supplied with the class if a constructor is also supplied - ANSWER-is
responsible for de-allocating resources when an object goes out of scope


is called multiple times by operator delete []


is called by operator delete


will be created automatically if none is supplied by the programmer

Assume that parent class Animal has a default constructor explicitly defined. Write a
derived class, Cat, and include a default constructor and a deconstructor. - ANSWER-
class Cat:public Animal
{
public:
Cat() : Animal()
{
std::cout << "Cat::Cat()\n";
}
~Cat()
{
std::cout << "Cat::~Cat()\n";
}
};

class Box
{
public:
Box (float length = 0, float width = 0, float height = 0);
virtual ~Box();
float Volume() const;
private:
float length_, width_, height_;
};

a) Box b (2,4,8);
b) b Box (2, 4, 8);
c) class Box b;
d) Box b; - ANSWER-Box b (2,4,8); Box b;

Consider the classes and client program defined below

class A
{

, public:
void F() { std::cout << "A::F()\n"; }
void G() { std::cout << "A::G()\n"; }
virtual void H() { std::cout << " A::H\n"; }
virtual ~A(){};
};

class B : public A
{
public:
void G() { std::cout << "B::G()\n"; }
void H() { std::cout << "B::H()\n"; }
};

#include<iostream>

int main()
{
A a;
B b;
A * p = new B;
a.F();
a.G();
a.H();
b.F();
b.G();
b.H();
p->F();
p->G();
p->H();
}

What is the screen output of this program? - ANSWER-A::F()
A::G()
A::H()
A::F()
B::G()
B::H()
A::F()
A::G()
B::H()

Consider the classes and client program defined below

class BClass
{

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CLOUND Exam
View profile
Follow You need to be logged in order to follow users or courses
Sold
601
Member since
2 year
Number of followers
389
Documents
10885
Last sold
1 week ago
PROF MM

HELLO WELCOME TO THIS PAGE WHERE YOU WILL FIND ALL EXAMS ,STUDY GUIDE ,CASE, TESTBANKS AND ANY OTHER STUDY MATERIALS,

3.9

116 reviews

5
58
4
16
3
29
2
3
1
10

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions