Multiple Choice 1. (TCO 2) In C++ terminology, (Points : 4) a class object is th
ID: 3542913 • Letter: M
Question
Multiple Choice
a class object is the same as a class member.
a class object is the same as a class access specifier.
a class object is the same as a nonmember function.
2. (TCO 2) In C++, the mechanism that allows you to combine data and the operations on those data in a single unit is called a(n) _____. (Points : 4) enumeration
class
member
struct
3. (TCO 2) Given:
bool clockType::equalTime(const clockType&) const {...}
void clockType::getTime(int&, int&, int&) const {...}
The word _____ at the end of the member functions in the class clockType specifies that these functions cannot modify the member variables of a clockType object. (Points : 4) void
const
clockType::
&
4. (TCO 2) A class and its members can be described graphically using a notation known as the _____ notation. (Points : 4) OON
OOD
UML
OOP
5. (TCO 2) Consider the following class definition.
class circleType
{
public:
void set(double r);
//Postcondition: radius = r;
void print();
//Output radius, area, and circumference.
double area();
//Postcondition: Calculate and return area.
double circumference();
//Postcondition: Calculate and return circumference.
circleType();
//Postcondition: radius = 0;
circleType(double r);
//Postcondition: radius = r;
private:
double radius;
};
and the declaration
circleType myCircle;
double r;
Which of the following statements are valid in C++?
(i)
cin >> r;
myCircle.area = 3.14 * r * r;
cout
(ii)
cin >> r;
myCircle.set(r);
cout (Points : 4) Only (i)
Only (ii)
Both (i) and (ii)
None of these
6. (TCO 3) Which is the correct UML connector to designate inheritance? (Points : 4)
7. (TCO 8) When creating a macro, which preprocessor directive is used? (Points : 4) ifndef
define
ifdef
endif
8. (TCO 8) Which is a correct preprocessor directive statement? (Points : 4) define PI = 3.141593
define PI = 3.141593;
#define PI 3.141593
#define PI = 3.141593
9. (TCO 8) What is the namespace commonly used with <iostream>? (Points : 4) std
standard
.h
cin and cout
10. (TCO 8) In the following statement, which are C++ reserved words?
using namespace std; (Points : 4) using, namespace, and std
using and namespace
using
namespace In C++ terminology, a class object is the same as a class instance. a class object is the same as a class ember. a class object is the same as a class access specifier. a class object is the same as a nonmember function. In C++, the mechanism that allows you to combine data and the operations on those data in a single unit is called a(n) _____. enumeration class member struct bool clockType::equalTime(const clockType&) const {...} void clockType::getTime(int&, int&, int&) const {...} The word _____ at the end of the member functions in the class clockType specifies that these functions cannot modify the member variables of a clockType object.
Explanation / Answer
And for number 8 its #define PI 3.141593
I accidently copied one with "="
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.