100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
C++ Programming Final Exam $7.99   Add to cart

Exam (elaborations)

C++ Programming Final Exam

 0 view  0 purchase
  • Course
  • Institution

C++ Programming Final Exam

Preview 2 out of 7  pages

  • June 4, 2024
  • 7
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
avatar-seller
C++ Programming Final Exam
A ______________ of a base class expects to be overridden in a derived class. -
ANS-virtual function

A class is a(n) ______________ that is defined by the programmer. - ANS-data type

A collection of statements that performs a specific task is a(n)... - ANS-function

A function ___________ eliminates the need to place a function definition before all
calls to the function. - ANS-prototype

A function is executed when it is... - ANS-called

A statement that starts with a hashtag (or pound) symbol (#) is called a ... -
ANS-preprocessor directive

A(n) ________ is a special built-in pointer that is available to a class's member function.
- ANS-this pointer

After the following statement executes, what value will the MAPLE enumerator be
stored as, in memory?

enum Tree { OAK, MAPLE, PRINE }; - ANS-1

An array can store a group of values, but the values must be... - ANS-the same data
type

Assume that myCar is an instance of the Car class and that the Car class has a
member function named accelerate. Write a C++ statement that calls the accelerate
function. - ANS-myCar.accelerate();

Assume that RetailItem is the name of a class, and it contains a void member function
named setPrice which accepts a double argument. Write a C++ statement that correctly
uses the scope resolution operator in the member function definition. - ANS-void
RetailItem::setPrice(double p)

, Assuming outFile is a file stream object and number is a variable, which statement
writes the contents of number to the file associated with outFile? - ANS-outFile <<
number;

Before a structure can be used, it must be ... - ANS-declared

C++ requires that a copy constructor's parameter be a(n)... - ANS-reference object

Every complete C++ program must have a
a. comment
b. function named main
c. cout statement
d. namespace - ANS-function named main

If you intend to place a block of statements within an if statement, you must place
__________ around the block. - ANS-curly braces {}

If you leave out the size declarator in an array definition, you must... - ANS-furnish an
initialization list.

If you place a semicolon after the statement:

if (x < y );

the compiler will... - ANS-interpret the semicolon as a null statement

in a cout statement, what two things will advance the output position to the beginning of
the next line? (#1, #2) - ANS-endl, \n

In object aggregation, one object is an attribute of another object, which creates a
__________ relationship. - ANS-"has a"

In OOP, ____________ allows you to create new classes based on existing classes. -
ANS-Inheritance

int numbers [ ] { 10, 20, 30 }

Write a statement that prints out the second element of the numbers array using pointer
notation. - ANS-cout << *(numbers +1)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller modockochieng06. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79978 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart