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

Problem set 11 - ubc 2023 - cpsc 110

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
06-12-2025
Written in
2025/2026

Problem set 11 - ubc 2023 - cpsc 110

Institution
Problem Set 11 - Ubc 2023 - Cpsc 110
Course
Problem set 11 - ubc 2023 - cpsc 110









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Problem set 11 - ubc 2023 - cpsc 110
Course
Problem set 11 - ubc 2023 - cpsc 110

Document information

Uploaded on
December 6, 2025
Number of pages
7
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

UBC 2024-CPSC 121 Review
Study online at https://quizlet.com/_gabqt9
1. Which among the following statements will produce this output on screen?
Select all that apply.

Tell me who your friends are,
and I'll tell you mine!

a) cout << "Tell me who your friends are," << endl << "and I'll tell you mine!";
b) cout << "Tell me who your friends are";
cout << "and I'll tell you mine!";
c) cout << "Tell me who your friends";
cout << "are,\nand I'll tell you mine!";
d) cout << "Tell me who your friends are," << endl;
cout << "and I'll tell you mine!";: a, c, d
2. Why does the code below fail to compile?

#include <iostream>
using namespace std;
int main ()
{
cout << "\"I'm here", John said" << endl;
return 0;
}

The code's expected output is shown below:
"I'm here", John said

Select one:
a) The " after the word here in the code incorrectly terminates the string.
b) There are no errors in the code and it produces the expected output.
c) The \" before the word I'm in the code in unnecessary.
d) The " after the word said in the code needs to be escaped (replace with \")
to properly terminate the string.: a
3. Identify the type of literal below.

"algorithm": string literal
4. Identify the type of literal below.

'Z': character literal

1/7

, UBC 2024-CPSC 121 Review
Study online at https://quizlet.com/_gabqt9
5. Identify the type of literal below.

"121": string literal
6. Identify the type of literal below.

121: integer literal
7. Identify the type of literal below.

2018.09: floating-point literal
8. Identify the type of literal below.

5: integer literal
9. Why is the identifier below identify a C++ variable name? Select all that
apply.

4th_Section#2

Select one or more:
a) It starts with a number.
b) It contains uppercase characters.
c) It contains a # symbol.
d) It contains a _ symbol.: a, c
10. What will be the result of the following relational operation? Assume that
age is 20.

age >= 18

Select one:
a) true
b) false: a
11. Identify whether the following statements perform promotion or demotion.

cout << 4.0/3 << endl;: promotion
12. Identify whether the following statements perform promotion or demotion.

double cash = 1000;: promotion
13. Identify whether the following statements perform promotion or demotion.

int age = 15.6;: demotion
2/7

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.
eduustudent stuvia
View profile
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
9 months
Number of followers
0
Documents
1572
Last sold
1 week ago

3.7

3 reviews

5
2
4
0
3
0
2
0
1
1

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