Top Banner
Programming I Final Exam 2010-2011 - Review
60

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.

Jan 20, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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.

Programming I

Final Exam 2010-2011 - Review

Page 2: 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.

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

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

True

False

Page 3: 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.

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

Another term for integers is whole numbers.

True

False

Page 4: 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.

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

Initializing a variable means assigning a value to it.

True

False

Page 5: 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.

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

C++ keywords cannot be used as identifiers.

True

False

Page 6: 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.

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

Page 7: 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.

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

Page 8: 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.

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

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

True

False

Page 9: 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.

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

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

True

False

Page 10: 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.

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

Constants do not have data types.

True

False

Page 11: 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.

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

The modulus operator is the % sign.

True

False

Page 12: 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.

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

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

True

False

Page 13: 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.

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

The * operator performs multiplication.

True

False

Page 14: 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.

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

Floating-point precision can affect calculations.

True

False

Page 15: 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.

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

The % operator returns the remainder of integer division.

True

False

Page 16: 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.

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

The number 5.6e15 is an example of exponential notation.

True

False

Page 17: 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.

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

Page 18: 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.

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

Page 19: 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.

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

Most algorithms follow a single path from beginning to end.

True

False

Page 20: 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.

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

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

True

False

Page 21: 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.

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

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

True

False

Page 22: 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.

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

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

True

False

Page 23: 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.

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

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

True

False

Page 24: 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.

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

Page 25: 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.

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

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

True

False

Page 26: 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.

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

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

True

False

Page 27: 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.

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

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

Page 28: 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.

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

Page 29: 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.

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

Boolean variables can have how many different values?

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

Page 30: 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.

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;

Page 31: 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.

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.

Page 32: 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.

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

Page 33: 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.

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

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

Page 34: 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.

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

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

Page 35: 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.

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

Page 36: 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.

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;

Page 37: 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.

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

Page 38: 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.

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

Page 39: 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.

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

Page 40: 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.

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

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

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

Page 41: 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.

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

Page 42: 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.

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);

Page 43: 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.

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

The symbol used for the not logical operator is

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

Page 44: 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.

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

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

a. sequenceb. selectionc. controld. branching

Page 45: 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.

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. : :

Page 46: 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.

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

Page 47: 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.

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

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

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

Page 48: 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.

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.

Page 49: 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.

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

Page 50: 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.

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

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

Page 51: 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.

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

Page 52: 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.

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

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

a. doubleb. intc. neither

Page 53: 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.

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)

Page 54: 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.

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)

Page 55: 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.

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

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

Page 56: 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.

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

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

Page 57: 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.

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

Page 58: 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.

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.

Page 59: 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.

WrongClick on button to return

to question slide.

Page 60: 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.

CorrectClick on button to return

to question slide.