Given the following string variable declaration and statements:
string title;
int i;
title = "One String";
which of the following is the correct statement that assigns the length of the variable title to the variable i?
Quiz 2: C++ Basics
Quiz
•
Computers
•
University
•
Medium
Xin Yang
Used 33+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following string variable declaration and statements:
string title;
int i;
title = "One String";
which of the following is the correct statement that assigns the length of the variable title to the variable i?
i = One String.length();
i = string.length();
i = title.length();
i = length();
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Given the following string variable declaration and statements:
string title;
int j;
title = "This is Adam";
cout << title.substr(1,5) << endl;
What is the correct output?
3.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Write a C++ statement that declares the variable firstInitial to be a character variable.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following string variable declaration:
string name;
string lastName = "Green";
string firstName = "Cathy";
which of the following statement is the correct statement that assigns Green, Cathy to the variable name.
name = "Green Cathy";
name = lastName +", " + firstName;
name = Green, Cathy;
name = Green + ", " + Cathy;
5.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the result of the following expression?
9/8
6.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is the result of the following expression?
11%9
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct function call to calculate 12^5
power(12,5)
power(5,12)
pow(12,5)
exp(12,5)
10 questions
Quiz 8: Arrays&Vector
Quiz
•
University
15 questions
C++ Quiz-1
Quiz
•
University
15 questions
BASIC C QUIZ
Quiz
•
University
14 questions
JavaScript
Quiz
•
University
15 questions
ASK F2 -KOD ARAHAN (PYTHON)
Quiz
•
1st Grade - University
10 questions
Pointeurs et références 2
Quiz
•
University
12 questions
Programação Web - PHP
Quiz
•
University
10 questions
Java Programming Basics
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade