Search Header Logo

CP2 / IP Finals Test B

Authored by Julieann Martinez

Information Technology (IT)

12th Grade

Used 9+ times

CP2 / IP Finals Test B
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

#include <iostream>

#include <string>

 

int main() {

    std::string name = "Teacher";

    std::cout << "Hello " + Name;

    return 0;

}

​ (a)  

2.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>

int main() {

int age;

std::cout << "Enter age: ";

std::cin >> age;

std::cout >> "Age is " >> age;

return 0;

}

​ (a)  

3.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>

 

int main() {

                   int count = 5;

                  

while (count > 0) {

                                       std::cout << count;

                                       count-;

                   return 0;

}

​ (a)  

4.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>

int main() {

int x = 10;

if (x = 5) {

std::cout << "x is 5";

}

return 0;

}

​ (a)  

5.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>

int main() {

int i = 5;

while (i > 0) {

std::cout << i << " ";

i++;

}

return 0;

}

​ (a)  

6.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>

int main() {

for (int i == 0; i < 10 i++) {

std::cout << i;

}

return 0;

}

​ (a)  

7.

FILL IN THE BLANKS QUESTION

1 min • 3 pts

FIND THE ERROR AND REWRITE THE ENTIRE LINE CORRECTLY.

 

#include <iostream>
using namespace std;

int main() {
int age = 15;

                    if(age >= 18) {
                    cout << "Adult";
                    } else (age < 18)
                    cout << "Minor";
                    }
return 0;
}

​ (a)  

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?