Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

Ece 206 Exam Questions And Correct Answers 100% Verified.

Document preview thumbnail
Preview 2 out of 7 pages

Ece 206 Exam Questions And Correct Answers 100% Verified. Which header file should be used while working with the output string stream? - Answer#include sstream _____ is a predefined ostream object that is pre-associated with a system's standard output, usually a computer screen. - Answercout To use an output file in a C++ program you must - Answeropen the file create a file stream object that will "point to" to the file do B and C, but not A The code for generates an error. Why? - AnswerThe file '' has not been opened The ____ function returns true if the previous stream operation had an error. - Answerfail() A program can insert characters into an ostringstream buffer using the ______ operator. - Answer Which XXX generates "Tim Smith is 19 years old." as the output? - AnswerplayerObj players " is " age " years old."; Why would a file fail to open? - AnswerThe file has incorrect file permissions or the disk is full. Which XXX will search the input name in the GuestL file? - Answerif (!inFS.fail()) Given an ofstream outFS, which syntax is used to check whether a file is opened successfully? - Answerif (!outFS.is_open()) { ... } To use files in a C++ program you must include the ________ header file. - Answerfstream If a file exists in a directory and contains data, when an ofstream is used to write data into the file _____. - Answerthe file is overwritten with the new data. Manipulators are defined in the _____ and _____ libraries in namespace std. - Answeriomanip; ios ©THESTAR 2024/2025 ALL RIGHTS RESERVED. 2 | P a g e The ostringstream member function ____ returns the contents of an ostringstream buffer as a string. - Answerstr() True/False: Both function headers and function calls must list the data types of all data being passed to the function. - AnswerFalse A(n) ________ argument is one that is automatically passed to a parameter when the argument is left out of the function call. - Answerdefault In a function prototype, in addition to the name of the function, you are required to furnish - Answerthe 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. - Answerstub The ________ statement causes a function to end and the flow of control to move back to the point where the function call was made. - Answerreturn In a function header, in addition to the name of the function, you are required to furnish - Answera 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 - Answerreturns no value Breaking a program up into a set of manageable sized functions is called ________ programming. - Answermodular When used as a parameter, a ________ variable allows a function to access and modify the original argument passed to it. - Answerreference A function ________ is a statement within the code that causes a function to actually execute. - Answercall True/False: When you make a function call, the order of the arguments you send does not matter as long as the number of arguments matches the number of parameters the function has. - AnswerFalse When more than one function has the same name they are called ________ functions. - Answeroverloaded

Content preview

©THESTAR 2024/2025 ALL RIGHTS RESERVED.




Ece 206 Exam Questions And Correct
Answers 100% Verified.



Which header file should be used while working with the output string stream? -
Answer✔#include <sstream>
_____ is a predefined ostream object that is pre-associated with a system's standard output,
usually a computer screen. - Answer✔cout

To use an output file in a C++ program you must - Answer✔open the file
create a file stream object that will "point to" to the file
do B and C, but not A

The code for myoutfile.txt generates an error. Why? - Answer✔The file 'myoutfile.txt' has not
been opened

The ____ function returns true if the previous stream operation had an error. - Answer✔fail()
A program can insert characters into an ostringstream buffer using the ______ operator. -
Answer✔<<

Which XXX generates "Tim Smith is 19 years old." as the output? - Answer✔playerObj <<
players << " is " << age << " years old.";

Why would a file fail to open? - Answer✔The file has incorrect file permissions or the disk is full.

Which XXX will search the input name in the GuestList.txt file? - Answer✔if (!inFS.fail())
Given an ofstream outFS, which syntax is used to check whether a file is opened successfully? -
Answer✔if (!outFS.is_open()) { ... }

To use files in a C++ program you must include the ________ header file. - Answer✔fstream
If a file exists in a directory and contains data, when an ofstream is used to write data into the
file _____. - Answer✔the file is overwritten with the new data.
Manipulators are defined in the _____ and _____ libraries in namespace std. -
Answer✔iomanip; ios

1|Page

, ©THESTAR 2024/2025 ALL RIGHTS RESERVED.

The ostringstream member function ____ returns the contents of an ostringstream buffer as a
string. - Answer✔str()
True/False: Both function headers and function calls must list the data types of all data being
passed to the function. - Answer✔False
A(n) ________ argument is one that is automatically passed to a parameter when the argument
is left out of the function call. - Answer✔default
In a function prototype, in addition to the name of the function, you are required to furnish -
Answer✔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. - Answer✔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. - Answer✔return
In a function header, in addition to the name of the function, you are required to furnish -
Answer✔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 - Answer✔returns no value
Breaking a program up into a set of manageable sized functions is called ________
programming. - Answer✔modular
When used as a parameter, a ________ variable allows a function to access and modify the
original argument passed to it. - Answer✔reference
A function ________ is a statement within the code that causes a function to actually execute. -
Answer✔call
True/False: When you make a function call, the order of the arguments you send does not
matter as long as the number of arguments matches the number of parameters the function
has. - Answer✔False
When more than one function has the same name they are called ________ functions. -
Answer✔overloaded




2|Page

Document information

Uploaded on
January 21, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TheStar
3.7
(140)
Sold
709
Followers
178
Items
26617
Last sold
5 days ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions