Deck 15: A Brief Introduction to C++
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/49
Play
Full screen (f)
Deck 15: A Brief Introduction to C++
1
The basic mathematical and assignment operators in C++ are different from those used in C.
False
2
Format manipulators are used in C++ to obtain formatted output.
True
3
C++ does not allow the use of pointers for indirect addressing.
False
4
C++ allows the use of references for indirect addressing.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
5
C++ uses object-oriented program design.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
6
C uses procedural program design.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
7
C was created from C++.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
8
C++ is sometimes referred to as "a better C".
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
9
Many introductory C++ courses are taught using procedural programs initially.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
10
/* this is a comment */ is not a valid C++ comment.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
11
Any text after the \\ delimiter, but only to the end of the current line, is taken to be a comment in C++.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
12
The header files in C++ are different from those in C, but perform the same task and occupy similar positions in a C++ program that they occupy in a C program.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
13
C++'s cin does not require the address operator needed for C's scanf() function.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
14
C++ uses newl to signify a new line.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
15
One of the driving forces in the creation of object-oriented languages was the inability of procedurally structured code to be extended easily without extensive revisions, retesting, and reevaluations.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
16
Object-oriented languages make it easier to reuse code in a manner that significantly increases software productivity.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
17
A data type provides both a set of values and a set of operations that can be applied to these values.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
18
A programmer-defined data type is known as an ADT.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
19
In a class, values defined for the data type can only be accessed and operated on by functions specified as part of the class.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
20
Polymorphism permits existing code, which has been thoroughly tested, to be reused efficiently without the need for extensive retesting.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
21
A parent class is also called a derived class.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
22
A derived class is also called a child class.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
23
Using polymorphism, existing operations on a base class can be left alone, without the need to retest and reverify them, while they are extended to a derived class.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
24
C++ is a true object-oriented language.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
25
In a true object-oriented language all programs would have to adhere to an object-oriented structure.
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
26
Use ____ to include standard input and output header files in a C program.
A)#include
B)using namespace std;
C)#include
D)#include
A)#include
B)using namespace std;
C)#include
D)#include
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
27
Use ____ to include standard input and output header files in a C++ program.
A)#include
B)using namespace std;
C)#include using namespace std;
D)#include
A)#include
B)using namespace std;
C)#include
D)#include
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
28
You can use ____ for standard input in C.
A)scanf()
B)read()
C)cin
D)cout
A)scanf()
B)read()
C)cin
D)cout
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
29
You can use ____ for standard input in C++.
A)sscanf()
B)read()
C)cin
D)cout
A)sscanf()
B)read()
C)cin
D)cout
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
30
You can use ____ for standard output t in C.
A)write()
B)printf()
C)cin
D)cout
A)write()
B)printf()
C)cin
D)cout
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
31
You can use ____ for standard output in C++.
A)write()
B)sprintf()
C)cin
D)cout
A)write()
B)sprintf()
C)cin
D)cout
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
32
An example of a use of cin is ____.
A)cin >> price;
B)cin -> price;
C)cin << price;
D)cin < price;
A)cin >> price;
B)cin -> price;
C)cin << price;
D)cin < price;
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
33
An example of a use of cout is ____.
A)cout >> "Hello World";
B)cout -> "Hello World";
C)cout << "Hello World";
D)cout < "Hello World";
A)cout >> "Hello World";
B)cout -> "Hello World";
C)cout << "Hello World";
D)cout < "Hello World";
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
34
The use of format manipulators in C++ requires the header file ____.
A)iostream
B)iomanip
C)namespace
D)std
A)iostream
B)iomanip
C)namespace
D)std
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
35
____ can be used instead of '\n' in C++.
A)'\0'
B)'\N'
C)newl
D)endl
A)'\0'
B)'\N'
C)newl
D)endl
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
36
____ is a C++ format manipulator.
A)iostream
B)endl
C)fixed
D)cout
A)iostream
B)endl
C)fixed
D)cout
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
37
____ is not a comment delimiter in C++.
A)/*
B)*/
C)//
D)\\
A)/*
B)*/
C)//
D)\\
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
38
printf("Enter the price: "); can be written in C++ as ____.
A)cout << "Enter the price: ";
B)cout >> "Enter the price: ";
C)cin << "Enter the price: ";
D)cin >> "Enter the price: ";
A)cout << "Enter the price: ";
B)cout >> "Enter the price: ";
C)cin << "Enter the price: ";
D)cin >> "Enter the price: ";
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
39
scanf("%lf", &price); can be written in C++ as ____.
A)cin << &price;
B)cin << price;
C)cin >> &price;
D)cin >> price;
A)cin << &price;
B)cin << price;
C)cin >> &price;
D)cin >> price;
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
40
/* this is a comment */ can be written in C++ as ____.
A)\\ this is a comment
B)// this is a comment
C)/ this is a comment /
D)*/ this is a comment /*
A)\\ this is a comment
B)// this is a comment
C)/ this is a comment /
D)*/ this is a comment /*
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
41
C++'s endl is equivalent to C's newline sequence '\n' followed by a(n) ____ function call.
A)flush()
B)force()
C)print()
D)out()
A)flush()
B)force()
C)print()
D)out()
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
42
The three features required for an object-oriented language are class construction, inheritance, and ____.
A)operator overloading
B)polymorphism
C)abstraction
D)encapsulation
A)operator overloading
B)polymorphism
C)abstraction
D)encapsulation
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
43
____ is the ability to create programmer-defined data types.
A)Polymorphism
B)Inheritance
C)Class construction
D)Encapsulation
A)Polymorphism
B)Inheritance
C)Class construction
D)Encapsulation
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
44
A ____ is a completely new data type that incorporates all of the data values and operations of one class with new data and operations that create a different and expanded class.
A)class instance
B)base class
C)specific class
D)derived class
A)class instance
B)base class
C)specific class
D)derived class
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
45
When using inheritance, the initial class is known as the ____.
A)parent class
B)child class
C)subclass
D)derived class
A)parent class
B)child class
C)subclass
D)derived class
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
46
When using inheritance, the derived class is known as the ____.
A)parent class
B)base class
C)subclass
D)initial class
A)parent class
B)base class
C)subclass
D)initial class
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
47
____ permits the same operation to invoke one set of results on data values of a base class and a different set of results on data values of a derived class.
A)Polymorphism
B)Inheritance
C)Class construction
D)Encapsulation
A)Polymorphism
B)Inheritance
C)Class construction
D)Encapsulation
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
48
Generic data types are available in C++ through the ____ library.
A)iostream
B)iomanip
C)STD
D)STL
A)iostream
B)iomanip
C)STD
D)STL
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck
49
C++ is sometimes known as a(n) ____ language.
A) interpreted
C) virtual
B) hybrid
D) procedural
A) interpreted
C) virtual
B) hybrid
D) procedural
Unlock Deck
Unlock for access to all 49 flashcards in this deck.
Unlock Deck
k this deck