Quiz 2: C++ Basics

Quiz 2: C++ Basics

University

11 Qs

quiz-placeholder

Similar activities

1-基本数据类型

1-基本数据类型

University

10 Qs

Listen in Python

Listen in Python

University

10 Qs

Chap 1: What is a program made of?

Chap 1: What is a program made of?

University

13 Qs

CompTIA Core 2  20221023

CompTIA Core 2 20221023

University

10 Qs

cp06-01-1D-Array

cp06-01-1D-Array

University

10 Qs

DAA quiz2

DAA quiz2

University

15 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

Quiz 2: C++ Basics

Quiz 2: C++ Basics

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Xin Yang

Used 38+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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)

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?