CSC 101 Final Review Questions with Correct Answers
11 views 0 purchase
Course
CSC 101
Institution
CSC 101
CSC 101 Final Review Questions with Correct Answers
Which of the following statements is used to simplify the accessing of all globalType namespace members? - Answer-using namespace globalType;
The identifiers in the system-provided header files such as iostream, cmath, and iomanip are defined...
CSC 101 Final Review Questions
with Correct Answers
Which of the following statements is used to simplify the accessing of all globalType
namespace members? - Answer-using namespace globalType;
The identifiers in the system-provided header files such as iostream, cmath, and
iomanip are defined in the namespace ____. - Answer-std
Before using the data type string, the program must include the header file ____. -
Answer-string
Suppose that str1, str2, and str3 are string variables. After the following statements
execute, the value of str3 is "____".
After the statement position = str.find('D'); executes, the value of position is ____. -
Answer-3
11 Considering the statement string str = "Gone with the wind";, the output of the
statement cout << str.find("the") <<
endl; is ____. - Answer-10
, 11 Consider the following statements.
string str1 = "ABCDEFGHIJKLM";
string str2;
After the statement str2 = str1.substr(1,4); executes, the value of str2 is "____". -
Answer-BCDE
11 Consider the following statements.
string str1 = "Gone with the wind";
string str2;
After the statement str2 = str1.substr(5,4); executes, the value of str2 is "____". -
Answer-with
11 The ____ function is used to interchange the contents of two string variables. -
Answer-swap
11 Which of the following statements declares alpha to be an array of 25 components of
the type int? - Answer-int alpha[25];
Assume you have the following declaration int beta[50];. Which of the following is a valid
element of beta? - Answer-beta[0]
What is the output of the following loop?
count = 5;
cout << 'St';
do
{
cout << 'o';
count--;
}
while (count <= 5); - Answer-This is an infinite loop.
____ loops are called post-test loops. - Answer-do...while
Which of the following loops does not have an entry condition? - Answer-do...while loop
The ____ statement can be used to eliminate the use of certain bool variables in a loop.
- Answer-break
What executes immediately after a continue statement in a while and do-while loop? -
Answer-loop-continue test
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Scholarsstudyguide. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $12.49. You're not tied to anything after your purchase.