Deck 13: Advanced Input and Output
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
Match between columns
Question
Question
Match between columns
Question
Match between columns
Question
Question
Match between columns
Question
Match between columns
Question
Match between columns
Question
Match between columns
Question
Question
Match between columns
Question
Question
Match between columns
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/55
Play
Full screen (f)
Deck 13: Advanced Input and Output
1
The ofile() function opens a data file.
False
2
The ____ function controls the number of significant digits you see in the output.
A) setw()
B) setprecision()
C) precision()
D) width()
A) setw()
B) setprecision()
C) precision()
D) width()
C
3
The ____ function defines the size of the output field in which the next output will be displayed.
A) setw()
B) setprecision()
C) precision()
D) width()
A) setw()
B) setprecision()
C) precision()
D) width()
D
4
The ____ manipulator specifies the number of significant digits to display.
A) setw()
B) setprecision()
C) precision()
D) width()
A) setw()
B) setprecision()
C) precision()
D) width()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
5
Temporary data storage exists in computer memory; it is lost when power is lost.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
6
The cin.get() statement can retrieve any character, including letters, numbers, punctuation, and white space such as the character generated by pressing the Enter key.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
7
The ____ function reads a line of text at the address represented by the first argument to the function until it reaches either the length used as the second argument or the character used as the third argument.
A) open()
B) ignore()
C) get()
D) getline()
A) open()
B) ignore()
C) get()
D) getline()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
8
____ I/O is unformatted; that is, bytes are transferred into and out from memory without regard to the type of data they represent.
A) Low-level
B) High-Level
C) Primitive
D) Advanced
A) Low-level
B) High-Level
C) Primitive
D) Advanced
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
9
____ I/O is formatted; that is, bytes are grouped into meaningful units such as integers, doubles, and class object types.
A) Low-level
B) High-Level
C) Primitive
D) Advanced
A) Low-level
B) High-Level
C) Primitive
D) Advanced
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
10
The ____ function takes arguments that set the bits of cout ; that is, the arguments turn the bits in the format flag on.
A) setw()
B) setprecision()
C) setf()
D) unsetf()
A) setw()
B) setprecision()
C) setf()
D) unsetf()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
11
The ____ function takes a character argument and returns a reference to the object that invoked the function.
A) open()
B) ignore()
C) get()
D) getline()
A) open()
B) ignore()
C) get()
D) getline()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ manipulator turns on bit codes for the attributes named as arguments.
A) setw()
B) setprecision()
C) setiosflags()
D) resetiosflags()
A) setw()
B) setprecision()
C) setiosflags()
D) resetiosflags()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
13
No matter how many decimal positions a number contains, C++ will display five positions if you do not explicitly set a precision for output.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
14
The ____ function skips any additional characters left in the input stream after data is accepted.
A) open()
B) ignore()
C) unsetf()
D) getline()
A) open()
B) ignore()
C) unsetf()
D) getline()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
15
A ____ is a way to create a shorter, easier-to-remember nickname for an unwieldy identifier.
A) fixed
B) showbase
C) setf()
D) typedef
A) fixed
B) showbase
C) setf()
D) typedef
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
16
The && and || operators are used for shifting bits in some contexts.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
17
Format flags are also known as state flags.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ manipulator allows you to set the width of a field for output.
A) setw()
B) setprecision()
C) setf()
D) width()
A) setw()
B) setprecision()
C) setf()
D) width()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
19
The ____ function can be used to deselect a bit in the format flag.
A) setw()
B) setprecision()
C) setf()
D) unsetf()
A) setw()
B) setprecision()
C) setf()
D) unsetf()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
20
All format flags begin with iosf:: .
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
21
____________________ flags are the arguments that determine the state of the cout object.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
22
A(n) ____________________ manipulator is a manipulator that takes an argument.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
23
The ____________________ manipulator displays numbers in hexadecimal form.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
24
C++ provides a(n) ____________________ manipulator to flush the stream without sending a newline character.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
25
The ____ manipulator turns off bit codes for the attributes named as arguments.
A) setw()
B) setprecision()
C) setiosflags()
D) resetiosflags()
A) setw()
B) setprecision()
C) setiosflags()
D) resetiosflags()
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
26
A(n) ____ mode indicates how a file is opened-for example, for input or output.
A) I/O
B) precision
C) stream
D) file
A) I/O
B) precision
C) stream
D) file
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
27
A ____ consists of a number of data fields that are logically connected because they pertain to the same entity.
A) data field
B) data hierarchy
C) data record
D) data file
A) data field
B) data hierarchy
C) data record
D) data file
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
28
The ____ manipulator displays octal numbers with a leading 0 and hexadecimal numbers with a leading 0x so you do not mistake them for base 10 (decimal) numbers.
A) showbase
B) oct
C) hex
D) fixed
A) showbase
B) oct
C) hex
D) fixed
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
29
In addition to endl , C++ provides a(n) ____________________ manipulator to send a null (or space) character rather than a newline.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
30
Write a program in which a 10-character limit is applied to the entry of a user's name. The program should use the get() function and display the message "Hello," followed by the user's name.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
31
Mention one advantage and one disadvantage of using the get() function instead of the extraction operator (>>) with cin for keyboard data entry.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
32
A ____ represents the relationships between the sizes of data units that business professionals most often use.
A) database
B) data hierarchy
C) data record
D) data file
A) database
B) data hierarchy
C) data record
D) data file
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) ____________________ character separates data fields.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
34
A ____ represents one piece of data, such as a first or last name, phone or Social Security number, or salary.
A) data field
B) data hierarchy
C) data record
D) data file
A) data field
B) data hierarchy
C) data record
D) data file
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
35
A group of related files is often stored in a ____.
A) database
B) data hierarchy
C) data record
D) data field
A) database
B) data hierarchy
C) data record
D) data field
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
36
The ____ is a key combination that indicates completion of data entry.
A) delimiting character
B) end-of-file indicator
C) data record
D) setiosflags
A) delimiting character
B) end-of-file indicator
C) data record
D) setiosflags
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
37
The ____ key combination can be used to indicate an end-of-file.
A) Ctrl-c
B) Ctrl-f
C) Ctrl-z
D) Ctrl-e
A) Ctrl-c
B) Ctrl-f
C) Ctrl-z
D) Ctrl-e
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
38
Why was Unicode developed?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
39
The ____________________ manipulator displays values in octal form.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
40
What is the syntax of the get() function?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
41
What happens when you use a delimiter other than '\n' with getline() ?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
42
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
43
What is a bit?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
44
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
45
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
46
What are some commonly used format flags?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
47
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
48
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
49
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
50
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
51
How is a file closed in C++?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
52
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
53
What are the ostream objects that C++ instantiates?
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
54
Match between columns
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck
55
Mention three file modes available in C++ for opening files.
Unlock Deck
Unlock for access to all 55 flashcards in this deck.
Unlock Deck
k this deck