ECE 206 EXAM QUESTIONS AND ANSWERS NEWEST
UPDATE 2024/2025 ACTUAL COMPLETE SOLUTION
WITH CORRECT DETAILED ANSWERS BEST TOP
RANKED TO SCORE A+ FOR PASS
Which XXX generates "Tim Smith is 19 years old." as the output? - CORRECT ANSWERS
playerObj << players << " is " << age << " years old.";
Why would a file fail to open? - CORRECT ANSWERS The file has incorrect file permissions
or the disk is full.
Which XXX will search the input name in the GuestList.txt file? - CORRECT ANSWERS if (!
inFS.fail())
Given an ofstream outFS, which syntax is used to check whether a file is opened
successfully? - CORRECT ANSWERS if (!outFS.is_open()) { ... }
To use files in a C++ program you must include the ________ header file. - CORRECT
ANSWERS fstream
If a file exists in a directory and contains data, when an ofstream is used to write data into
the file _____. - CORRECT ANSWERS the file is overwritten with the new data.
Manipulators are defined in the _____ and _____ libraries in namespace std. - CORRECT
ANSWERS iomanip; ios
The ostringstream member function ____ returns the contents of an ostringstream buffer as
a string. - CORRECT ANSWERS str()
True/False: Both function headers and function calls must list the data types of all data being
passed to the function. - CORRECT ANSWERS False
A(n) ________ argument is one that is automatically passed to a parameter when the
argument is left out of the function call. - CORRECT ANSWERS default
, ECE 206 EXAM QUESTIONS AND ANSWERS NEWEST
UPDATE 2024/2025 ACTUAL COMPLETE SOLUTION
WITH CORRECT DETAILED ANSWERS BEST TOP
RANKED TO SCORE A+ FOR PASS
In a function prototype, in addition to the name of the function, you are required to furnish -
CORRECT ANSWERS the data type of the return value.
a data type for each parameter.
A and C, but not B.
A ________ is a dummy function that is called instead of the actual function it represents, to
test that the call to and return from the function are working correctly. - CORRECT ANSWERS
stub
The ________ statement causes a function to end and the flow of control to move back to
the point where the function call was made. - CORRECT ANSWERS return
In a function header, in addition to the name of the function, you are required to furnish -
CORRECT ANSWERS a data type for each parameter.
an identifier name for each parameter.
the data type of the return value.
all of the above.
A void function is one that - CORRECT ANSWERS returns no value
Breaking a program up into a set of manageable sized functions is called ________
programming. - CORRECT ANSWERS modular
When used as a parameter, a ________ variable allows a function to access and modify the
original argument passed to it. - CORRECT ANSWERS reference
A function ________ is a statement within the code that causes a function to actually
execute. - CORRECT ANSWERS call
UPDATE 2024/2025 ACTUAL COMPLETE SOLUTION
WITH CORRECT DETAILED ANSWERS BEST TOP
RANKED TO SCORE A+ FOR PASS
Which XXX generates "Tim Smith is 19 years old." as the output? - CORRECT ANSWERS
playerObj << players << " is " << age << " years old.";
Why would a file fail to open? - CORRECT ANSWERS The file has incorrect file permissions
or the disk is full.
Which XXX will search the input name in the GuestList.txt file? - CORRECT ANSWERS if (!
inFS.fail())
Given an ofstream outFS, which syntax is used to check whether a file is opened
successfully? - CORRECT ANSWERS if (!outFS.is_open()) { ... }
To use files in a C++ program you must include the ________ header file. - CORRECT
ANSWERS fstream
If a file exists in a directory and contains data, when an ofstream is used to write data into
the file _____. - CORRECT ANSWERS the file is overwritten with the new data.
Manipulators are defined in the _____ and _____ libraries in namespace std. - CORRECT
ANSWERS iomanip; ios
The ostringstream member function ____ returns the contents of an ostringstream buffer as
a string. - CORRECT ANSWERS str()
True/False: Both function headers and function calls must list the data types of all data being
passed to the function. - CORRECT ANSWERS False
A(n) ________ argument is one that is automatically passed to a parameter when the
argument is left out of the function call. - CORRECT ANSWERS default
, ECE 206 EXAM QUESTIONS AND ANSWERS NEWEST
UPDATE 2024/2025 ACTUAL COMPLETE SOLUTION
WITH CORRECT DETAILED ANSWERS BEST TOP
RANKED TO SCORE A+ FOR PASS
In a function prototype, in addition to the name of the function, you are required to furnish -
CORRECT ANSWERS the data type of the return value.
a data type for each parameter.
A and C, but not B.
A ________ is a dummy function that is called instead of the actual function it represents, to
test that the call to and return from the function are working correctly. - CORRECT ANSWERS
stub
The ________ statement causes a function to end and the flow of control to move back to
the point where the function call was made. - CORRECT ANSWERS return
In a function header, in addition to the name of the function, you are required to furnish -
CORRECT ANSWERS a data type for each parameter.
an identifier name for each parameter.
the data type of the return value.
all of the above.
A void function is one that - CORRECT ANSWERS returns no value
Breaking a program up into a set of manageable sized functions is called ________
programming. - CORRECT ANSWERS modular
When used as a parameter, a ________ variable allows a function to access and modify the
original argument passed to it. - CORRECT ANSWERS reference
A function ________ is a statement within the code that causes a function to actually
execute. - CORRECT ANSWERS call