Language c++:    1. Given string str is "Great", which choice has all matching expressions? Group of answer choices a. str == "Great" b. str == "Great", str == "great" c. str == "Great", str == "Great!" d. str == "Great", str == "great", str == "Great!"   2. What is the ending value of userString? (Note the question asks about userString, not about x). userString = "FaceBook"; x = tolower(userString.at(4));   a.  "Facebook" b. "FaceBook" c. "Faceook" d. "b"   3. Which expression evaluates to true if the corresponding characters of strings s1 and s2 are equal independent of case? Ex: "C" and "c" should be considered equal. Group of answer choices a. str1.at(i) == str2.at(i) b. str1.at((tolower(i)) == str2.at(tolower(i)) c. str1.at(i) == toupper(str2.at(i)) d. toupper(str1.at(i)) == toupper(str2.at(i))   4. Given string str1 and string str2, which expression is true? str1 = "Hi"; str2 = "Hello";   Group of answer choices a. str1 < str2 b. str1 > str2 c. str1 <= str2 d. (Comparison not possible)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Language c++: 

 

1. Given string str is "Great", which choice has all matching expressions?

Group of answer choices
a. str == "Great"
b. str == "Great", str == "great"
c. str == "Great", str == "Great!"
d. str == "Great", str == "great", str == "Great!"
 
2.

What is the ending value of userString? (Note the question asks about userString, not about x).

userString = "FaceBook";
x = tolower(userString.at(4));
 
a.  "Facebook"
b. "FaceBook"
c. "Faceook"
d. "b"
 

3. Which expression evaluates to true if the corresponding characters of strings s1 and s2 are equal independent of case? Ex: "C" and "c" should be considered equal.

Group of answer choices
a. str1.at(i) == str2.at(i)
b. str1.at((tolower(i)) == str2.at(tolower(i))
c. str1.at(i) == toupper(str2.at(i))
d. toupper(str1.at(i)) == toupper(str2.at(i))
 

4. Given string str1 and string str2, which expression is true?

str1 = "Hi";
str2 = "Hello";
 
Group of answer choices
a. str1 < str2
b. str1 > str2
c. str1 <= str2
d. (Comparison not possible)
 
 
5. Which expression for XXX causes the code to output the strings in alphabetical order? (Assume the strings are lowercase)
if (XXX) {
cout << firstStr << " " << secondStr << endl;
}
else {
cout << secondStr << " " << firstStr << endl;
}
 
Group of answer choices
a. firstStr == secondStr
b. firstStr < secondStr
c. firstStr > secondStr
d. firstStr != secondStr
 

6. For the string "on time", what character is at index 3?

Group of answer choices
a. (Space)
b. t
c. i
d. m
 

7. Given str = "Cat", what is the result of this statement?

str.at(1) = "ab";
 
Group of answer choices
a. str is "abt"
b. str is "Catab"
c. str is "Cab"
d. Error: Assigning a character with a string is not allowed
 
 

8. What is the relation between a string's length and the string's last index?

Group of answer choices
a. lastIndex == length
b. lastIndex == length - 1
c. lastIndex == length + 1
d. lastIndex == length + 2
 
 
 

9. Given string s is "Sunday", what is the ending value of char myChar?

myChar = s.at(s.size() - 1);
 
Group of answer choices
a. a
b. y
c. "
d. No such character
 

10. Given userStr = "Doghouse", what is the ending value of char x?

x = tolower(userStr.at(2));
 
Group of answer choices
a. G
b. g
c. (Space)
d. Error: Compiler complains about converting an already-lowercase letter
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education