Content Frame
Note for screen reader users: There is text between the form elements on this page. To be sure that you do not miss any text, use item by item navigation methods, rather than tabbing from form element to form element.
Skip Breadcrumb Navigation
Home  arrow Student Resources  arrow Quizzes  arrow Chapter 1

Chapter 1

C++ Basics

This activity contains 10 questions.

Question 1.
Which of the following is a valid name for an identifier?

 
End of Question 1


Question 2.
What data types can be used to store numeric values with a decimal point, such as 3.14 ?

 
End of Question 2


Question 3.
Which of the following statements will correctly output the quote:

    Dan Quayle once said, "Who's responsible for the riots? The rioters."

 
End of Question 3


Question 4.
What value is stored in variable x?

int x;
x = 2 * 3 + 4 * 5 -- 4 / 2;

 
End of Question 4


Question 5.
What value is stored in x after the following two statements are executed:

int x;
x = 2 / 4 * 4 / 2;

 
End of Question 5


Question 6.
Runners often think of their speed in terms of how many minutes and seconds it takes to run a mile, but most treadmills express speed in miles per hour. Which expression correctly converts from 6.5 miles per hour to output the pace in minutes and seconds?

 
End of Question 6


Question 7.
What will the following code output?
    int x, y;
    x=3;
    y=(++x)*2;
    cout << x << " " << y << endl;

 
End of Question 7


Question 8.
How can we input a value from the keyboard and store it in the variable named num?

 
End of Question 8


Question 9.
Which of the following is an invalid comment?

 
End of Question 9


Question 10.
For a newer C++ compiler, what must be added to the top of the program to allow access to cin and cout?

 
End of Question 10





Pearson Copyright © 1995 - 2010 Pearson Education . All rights reserved. Pearson Addison Wesley is an imprint of Pearson .
Legal Notice | Privacy Policy | Permissions

Return to the Top of this Page