C++ While Loops

C++ While Loops

6th - 8th Grade

15 Qs

quiz-placeholder

Similar activities

Maze game

Maze game

5th - 7th Grade

11 Qs

loop while/do while

loop while/do while

7th - 12th Grade

10 Qs

QBASIC Programming

QBASIC Programming

5th - 10th Grade

10 Qs

HTML Öğreniyorum!

HTML Öğreniyorum!

8th Grade

10 Qs

What is Science/Science in Action

What is Science/Science in Action

6th Grade

20 Qs

Python lesson 3

Python lesson 3

8th Grade

11 Qs

A1 Investigative skills 2

A1 Investigative skills 2

5th - 9th Grade

11 Qs

Computación - 6to de básica

Computación - 6to de básica

6th Grade

10 Qs

C++ While Loops

C++ While Loops

Assessment

Quiz

Computers, Science

6th - 8th Grade

Practice Problem

Hard

Created by

Natalia Fumero

Used 204+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Make this code stop looping once you get the right answer:


string answer;

bool hasGuessed = false;


while(true) {


cin>> answer;


if (answer == “the right answer”){

__________

}


}

hasGuessed == false

hasGussed == true

hasGuessed = true;

hasGuessed = false;

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Make this code loop three times:


in tries= 0;


while(_________ ) {

cin>> “Looping!”;

tries++;


}

tries < 3

answer == 3

tries > 0

tries < 0

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Make this code stop looping when you get the right answer or have no more tries left


string answer;

int tries = 5;


while(_________) {

cin>> answer;

if (answer == “the right answer”){

cout<<“correct”<<endl;

break;

}

tries - - ;

}

tries == answer

tries > 0

tries >= 3

tries <= 5

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these statements stops a while loop?

stop;

break;

loop pause;

do { }

5.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

Fill in the blank with the right symbol to make this code print Tacos 4 times


int tacos = 4;


while(tacos ___ 0){

cout<<“Tacos”<<endl;


tacos - - ;

}

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Fill in the blank to make this code print Go Heat!

3 times


int loop = 0;


while(__________){

cout<<“Go Heat”<<endl;


loop ++ ;

}

loop < 3

answer == 3

loop = 0

loop == 3

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Fill in the blank with the right symbol to make this code print I'm a coder

3 times


int loop = 0;


while(loop __ 3){

cout<<“I'm a coder”<<endl;


loop ++ ;

}

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

Already have an account?

Discover more resources for Computers