What is the output of the following code?
?
queueType queue;
int x, y;
?
x = 2;
y = 6;
queue.addQueue(x);
queue.addQueue(y);
x = queue.front();
queue.deleteQueue();
queue.addQueue(x + 2);
queue.addQueue(x);
queue.addQueue(y - 3);
?
while (!queue.isEmptyQueue())
{
   cout << queue.front() << " ";
   queue.deleteQueue();
}
cout << endl
?

A. 6 2 3 3
B. 6 2 4 2
C. 6 3 3 3
D. 6 4 2 3


Answer: D

Computer Science & Information Technology

You might also like to view...

Case-Based Critical Thinking QuestionsCase 1You are making your favorite cookie recipe. You have all the ingredients on hand.You follow the recipe step by step. This is an example of a ____ structure.

A. sequence B. selection C. while D. loop

Computer Science & Information Technology

The Polygon Mode option of the ____________________ tool can be used to draw straight lines and connect them.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

If someone has an idea for a potential business, he/she might seek funding from a(n) ________

A) auctioneer B) publishing company C) disintermediationist D) venture capitalist

Computer Science & Information Technology

The dashed border in the accompanying figure indicates that the graphic is a(n) ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology