Search Header Logo

CPP-TESTING

Authored by John Oli

Information Technology (IT)

University

Used 1+ times

CPP-TESTING
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

FILL IN THE BLANK To declare a floating-point variable named "price" with value 10.50,

float _____ = 10.50;

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

MULTIPLE CHOICE What will be the output of:

cout << fixed << setprecision(2) << 5.678;

5.67

5.68

5.6

5.678

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

TRUE/FALSE The statement float total = price * quantity; performs addition.

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

MULTIPLE CHOICE Which data type would be most appropriate for storing the number of items sold?

float

int

char

string

5.

FILL IN THE BLANK QUESTION

1 min • 10 pts

Media Image

CODE COMPLETION Complete this code to calculate and display the total:

float apple = 5.50,

banana = 3.25;

float _______ = apple + banana;

cout << "Total: " << _______;

6.

FILL IN THE BLANK QUESTION

1 min • 10 pts

Media Image

OUTPUT PREDICTION

What will be the output / Display of this code?

int x = 25; int y = 4;

int result = x / y;

cout << "Answer: " << result;

7.

FILL IN THE BLANK QUESTION

1 min • 10 pts

Media Image

OUTPUT PREDICTION

What will this display?

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?