programming i final exam 2010-2011 - review. question..true or false (please click on the answer...)...

Post on 20-Jan-2016

218 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Programming I

Final Exam 2010-2011 - Review

Question..True or False(Please click on the answer...)

Variables hold data that may change while the program is running.

True

False

Question..True or False(Please click on the answer...)

Another term for integers is whole numbers.

True

False

Question..True or False(Please click on the answer...)

Initializing a variable means assigning a value to it.

True

False

Question..True or False(Please click on the answer...)

C++ keywords cannot be used as identifiers.

True

False

Question..True or False(Please click on the answer...)

In C++ it is possible to declare more than one variable in one statement.

True

False

Question..True or False(Please click on the answer...)

In C++ it is possible to declare more than one variable in one statement.

True

False

Question..True or False(Please click on the answer...)

Boolean variables are those that can have only three possible values.

True

False

Question..True or False(Please click on the answer...)

In C++ constants hold data that does not change as the program runs.

True

False

Question..True or False(Please click on the answer...)

Constants do not have data types.

True

False

Question..True or False(Please click on the answer...)

The modulus operator is the % sign.

True

False

Question..True or False(Please click on the answer...)

Overflow occurs when a number is too small for a variable.

True

False

Question..True or False(Please click on the answer...)

The * operator performs multiplication.

True

False

Question..True or False(Please click on the answer...)

Floating-point precision can affect calculations.

True

False

Question..True or False(Please click on the answer...)

The % operator returns the remainder of integer division.

True

False

Question..True or False(Please click on the answer...)

The number 5.6e15 is an example of exponential notation.

True

False

Question..True or False(Please click on the answer...)

A floating-point number would be truncated if it were converted to an integer.

True

False

Question..True or False(Please click on the answer...)

Floating-point rounding errors can occur if you are not aware of the data types used in calculations.

True

False

Question..True or False(Please click on the answer...)

Most algorithms follow a single path from beginning to end.

True

False

Question..True or False(Please click on the answer...)

Programs sometimes have to make decisions based on the wishes of the user.

True

False

Question..True or False(Please click on the answer...)

Logical operators allow an expression to evaluate more than one condition.

True

False

Question..True or False(Please click on the answer...)

Structures that make decisions in C++ programs are called sequence structures.

True

False

Question..True or False(Please click on the answer...)

The if/else structure is also called a two-way selection structure.

True

False

Question..True or False(Please click on the answer...)

A statement block has to end with a semicolon after the right curly brace.

True

False

Question..True or False(Please click on the answer...)

Programs sometimes have to make decisions based on the wishes of the user.

True

False

Question..True or False(Please click on the answer...)

C++ identifiers can begin with a letter or number.

True

False

Question..Multiple Choice(Please click on the answer...)

What is another term for integer?a. Whole numberb. Fractional numberc. Floating point numberd. Character

Question..Multiple Choice(Please click on the answer...)

Which of the following is a legal identifier?a. Number of carsb. 4salepricec. doubled. number_of_cars

Question..Multiple Choice(Please click on the answer...)

Boolean variables can have how many different values?

a. 1b. 2c. 3d. 4

Question..Multiple Choice(Please click on the answer...)

Which of the following is the proper way to declare and initialize a constant?

a. const double PI = 3.14159;b. double PI = 3.14159;c. const PI = 3.14159;d. PI = 3.14159;

Question..Multiple Choice(Please click on the answer...)

When variables are first declared:a. They have a value of zero.b. They reveive the default value for

their data type.c. They have an indeterminate value.d. They have a value of null.

Question..Multiple Choice(Please click on the answer...)

Which of the following is true of naming variables?

a. Variable names can have spacesb. Variable names can begin with

numbersc. Variable names may contain an

underscored. Variable names may also be C++

keywords

Question..Multiple Choice(Please click on the answer...)

Another name for exponential notation is:a. Long notationb. Unsigned notationc. Scientific notationd. Floating point notation

Question..Multiple Choice(Please click on the answer...)

What must identifiers begin with?a. A numberb. A letterc. An integerd. A space

Question..Multiple Choice(Please click on the answer...)

A group of characters put together to form a word or phrase is called:

a. A byteb. A messagec. A stringd. An ASCII stream

Question..Multiple Choice(Please click on the answer...)

Which of the following statements is a valid way to initialize multiple variables to the same value of a single statement line?

a. X, y, z = 200;b. X = y = z = 200;c. X; y; & z= 200;d. X & Y & Z = 200;

Question..Multiple Choice(Please click on the answer...)

The highest precedence when evaluating an expression is

a. Addition or subtractionb. Minus sign used to change signc. Multiplication and divisiond. None of these

Question..Multiple Choice(Please click on the answer...)

An overflow condition occurs whena. A value is too large for its data typeb. A decimal value is stored into an

integer fieldc. Too many variables are defined in

one programd. An integer is divided by a floating-

point number

Question..Multiple Choice(Please click on the answer...)

If y=3 and z=5, the statement x = y + ++z; will return a value of _____.

a. 8b. 9c. 10d. 11

Question..Multiple Choice(Please click on the answer...)

The symbol used in C++ for the modulus operator is the

a. &b. *c. %d. $

Question..Multiple Choice(Please click on the answer...)

A variable set to a Boolean value of false will contain a(n) ____ in memory.

a. oneb. zeroc. Fd. No

Question..Multiple Choice(Please click on the answer...)

Which of the following statements does not use a relational operator?

a. x = (4 > 5);b. x = (4 <= 5);c. x = (4 != 5);d. x = (4 = 5);

Question..Multiple Choice(Please click on the answer...)

The symbol used for the not logical operator is

a. &b. !c. -d. ~

Question..Multiple Choice(Please click on the answer...)

Decision-making structures in C++ are called ____ structures.

a. sequenceb. selectionc. controld. branching

Question..Multiple Choice(Please click on the answer...)

Which of the following shows the symbols that must surround a block of code for an if structure?

a. [ ]b. ( )c. { }d. : :

Question..Multiple Choice(Please click on the answer...)

The ____ keyword can be used within a switch structure to execute specific code if no other conditions are matched.

a. continueb. breakc. if_otherd. default

Question..Multiple Choice(Please click on the answer...)

Which operator is used to represent "less than or equal to"?

a. <b. >=c. <=d. =<

Question..Multiple Choice(Please click on the answer...)

In the problem solving steps of software development, which step occurs after program documenting?

a. Run the program.b. Test the results.c. Write code for the program.d. Algorithm development.

Question..Multiple Choice(Please click on the answer...)

Name an issue that is not important during problem solving for a programming team.

a. Writing styleb. Techniquec. Rewriting coded. Communication

Question..Multiple Choice(Please click on the answer...)

What can a valid identifier not consist of?a. Forward slashesb. Underscorec. Lettersd. Digits

Question..Multiple Choice(Please click on the answer...)

Tell if the expression is double, int, or neither: 3.0 + 4.0

a. doubleb. intc. neither

Question..Multiple Choice(Please click on the answer...)

Tell if the expression is double, int, or neither: 5 / 3

a. doubleb. intc. neither

Question..Multiple Choice(Please click on the answer...)

Which of the following statements would assign the value of 40 to the variable Test8?

a. Test8 < = 40b. Test8 = 40c. 40 = Test8d. cin >> (Test8 = 40)

Question..Multiple Choice(Please click on the answer...)

Which of the following expressions would assign the sum of A, B, and C to the variable D?

a. D = A + B + Cb. A + B + C = Dc. D <= A + B + Cd. sum (D = A + B + C)

Question..Multiple Choice(Please click on the answer...)

Which is not a C++ data type?a. doubleb. constantc. intd. char

Question..Multiple Choice(Please click on the answer...)

Which is not a relational operator?a. !!b. >=c. ==d. >

Question..Multiple Choice(Please click on the answer...)

Which of the following values can be assigned to a Boolean variable?

a. 15b. Tc. trued. tr

Question..Multiple Choice(Please click on the answer...)

Given the statement: if (A > 70) || (A < 110) ....

which value of A would make this statement true?

a. 60b. 75c. 130d. All of these.

WrongClick on button to return

to question slide.

CorrectClick on button to return

to question slide.

top related