Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. In C++, operator<< comes in two overloaded forms, one that takes one argument

ID: 3556915 • Letter: 1

Question

1. In C++, operator<< comes in two overloaded forms, one that takes one argument and one that takes two arguments.(T/F)

2.

Which of the following statements is a valid way to create a Blockbuster object?

a. cs52::Blockbuster b( 100, "Rambo", "Sylvester Stallone" );

b. std::Blockbuster b( 100, "Rambo" );

c. std::Blockbuster b( 100, "Rambo", "Sylvester Stallone" );

d. cs52::Blockbuster b;

3. Default-valued parameter arguments do not need to be passed when invoking the function that defines their value.(T/F)

4. In the declaration:
   int myArray[ 10 ];
a total of 10 integer values will make up this array.(T/F)

5. The accessor ("getter") methods of a class are typically marked with the const modifier.(T/F)

6.The Programmer is working to improve the SodaCan class. She decides to make a parameterless constructor so that driver code can conveniently say:

SodaCan s;

and have everything still compile and work properly. In her implementation of the parameterless constructor, she writes:

SodaCan::SodaCan() {
// empty...
}

What is wrong with her approach and what would you recommend she do to avoid potential problems?

Explanation / Answer

1. false
2. c
3. true
4. true
5. false
6. create object