100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CSC 101 Final Review Questions with Correct Answers

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
18-09-2024
Written in
2024/2025

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 "____". str1 = "abc"; str2 = "xyz"; str3 = str1 + '-' + str2; - Answer-abc-xyz Suppose str = "xyzw";. After the statement str[2] = 'Y'; The value of str is "____". - Answer-xyYw Suppose str = "ABCDEFGHI". The output of the statement cout h() endl; - Answer-9 The length of the string "Hello There. " is ____. - Answer-13 11 Consider the following statements. string str = "ABCDEFD"; string::size_type position; After the statement position = ('D'); executes, the value of position is ____. - Answer-3

Show more Read less
Institution
CSC 101
Course
CSC 101

Content preview

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 "____".

str1 = "abc";
str2 = "xyz";
str3 = str1 + '-' + str2; - Answer-abc-xyz

Suppose str = "xyzw";. After the statement str[2] = 'Y'; The value of str is "____". -
Answer-xyYw

Suppose str = "ABCDEFGHI". The output of the statement

cout << str.length() << endl; - Answer-9

The length of the string "Hello There. " is ____. - Answer-13

11 Consider the following statements.

string str = "ABCDEFD";
string::size_type position;

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

Written for

Institution
CSC 101
Course
CSC 101

Document information

Uploaded on
September 18, 2024
Number of pages
11
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

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.
Scholarsstudyguide nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
808
Member since
3 year
Number of followers
476
Documents
15713
Last sold
2 days ago
NURSING

Here you will find everything you need in nursing Assignments, EXAMS AND TESTBANKS. For students who want to see results twice as fast. I strive for my content to be of the highest quality. Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied.

3.9

165 reviews

5
87
4
21
3
27
2
6
1
24

Trending documents

Recently viewed by you

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

Frequently asked questions