CIS 170C Final Exam

$23.00

CIS 170C Final Exam 
(TCO 3) Explain the naming rules for creating variables and then provide three examples using the data types int…

 

SKU: CIS 170C Final Exam  Categories: , Tags: , ,

Description

CIS 170C Final Exam 

CIS 170C Final Exam

A+

(TCO 1) Which of the following statement about IDE is true? (Points : 4)

IDE only allows programmers to editing their code

IDE provides editing, compiling, and debugging in one software package.

Visual Studio.Net is not an IDE.

IDE stands for integrated development engine.

(TCO 2) What does the symbol << represent in C++ programming? (Points : 4)

Bout

Bin

Cin

Count

(TCO 2) A Main Function is enclosed inside _____. (Points : 4)

Box brackets

Curly braces

Parentheses

Quotes

(TCO 2) To improve readability and maintainability, you should declare _____ instead of using literal values such as 3.14159. (Points : 4)

Variables

Functions

Classes

Constants

(TCO 3) What is the value of x after the following statement?
float x;
x = 3.0 / 4.0 + 3 + 2 / 5 (Points : 4)

1.75

3.75

5.75

4.15

(TCO 4) _____ is often used in the design of a program to describe the program processing. (Points : 4)

Pseudocode

Algorithm

Program control

Data flow

(TCO 4) What is the decision symbol in a flow chart? (Points : 4)

Square

Rectangle

Circle
Diamond

(TCO 4) Which of the following is true about if/else structure? (Points : 4)

If structure is a single selection structure.

If/else structure is a dual selection structure.

If/else structure can be nested.

All of the above

(TCO 5) Which structure causes a statement or set of statements to execute repeatedly? (Points : 4)

Decision

Repetition

Sequence

None of the above

(TCO 5) Which repetition structure is designed to have the code execute at least one time? (Points : 4)

For loop

Do in a while loop

While loop

Do while loop

(TCO 5) The while loop has two important parts: an expression that is tested for a true or false value, and _____. (Points : 4)

A statement or block that is repeated as long as the expression is true

A statement or block that is repeated only if the expression is false

One line of code that is repeated once if the expression is true

A statement or block that is repeated once if the expression is true

(TCO 5) A loop that never stops is called _____. (Points : 4)

A nested loop

An infinite loop

A pretest loop

A post-test loop

(TCO 6) Debugging is like being a(n) _____. (Points : 4)

Accountant

Attorney
Police officer

Detective

(TCO 7) Code written in a specific format to perform a single task or calculation is called a _____. (Points : 4)

Function

Loop

Decision statement

Task

(TCO 8) Unless otherwise specified, C++ variables are automatically passed by _____. (Points : 4)

Parameter

Argument

Reference

Value

(TCO 7) A return statement is not needed in a _____. (Points : 4)

Defined stack

Void function

Stacked function

Declared stack

(TCO 8) What character is used to indicate a reference parameter? (Points : 4)

$

&

@

^

(TCO 8) The parameter of the following function is a(n) _____.  char myFunction (int &x); (Points : 4)

Action parameter

Illegal parameter

Value parameter

Reference parameter
(TCO 9) What type of menu first displays the main menu and then, based on the user’s selection, displays a submenu?(Points : 4)

Single-level menu

Multiple-level menu

Step-level menu

Sublevel menu

(TCO 9) What is the method used to make sure that valid selections are processed? (Points : 4)

Input validation loop

Including the default clause in the case structure

Use of an else clause

All of the above

(TCO 9) What software entity contains both data and procedures (actions on the data)? (Points : 4)

Objects

Instances

Events

All of the above

(TCO 10) To halt the execution of a program at a specific spot during debugging, you must use a _____. (Points : 4)

Scope resolution operator

Step

Comment

Break point

(TCO 11) If n represents the size of an array, what would be the index of the last element in the array? (Points : 4)

n-2

n

n-1

Cannot be determined

(TCO 11) When working with an array, the easiest way to traverse or visit all elements of the array is to _____. (Points : 4)

Use a loop statement

Sort the array and read it

Do a binary search

Use sequential coding

(TCO 11) Given: myArray[3][4], what is the index for the first element (located in the first row and first column)?

[1][1]

[0][1]

[1][0]

[0][0]

(TCO 12) Given the following array:

int profit [5] = {10, 20, 31, 55, 66};

The following statement would replace which value?
profit [3] = profit[2 – 1]; (Points : 4)

55 with 10

31 with 10

31 with 20

55 with 20

(TCO 12) What is the character automatically included at the end of an array of characters? (Points : 4)

\n

\0

\z

\*

(TCO 13) Sequential files are accessed in _____. (Points : 4)

Random order

Binary order

Consecutive order

None of the above

(TCO 13) Sometimes, a project will need to save data inputted by the user so it can be used again. This data stored will later be accessed from a _____. (Points : 4)

Program file

Project file

Data file

User file

(TCO 13) Once you finish using a file, you should _____. (Points : 4)

Append it

Exit it

Output it

None of the above

(TCO 13) Compare and contrast the mode operators ios::in, ios::app, and ios::out. Provide a C++ code segment that illustrates the use of these mode operators. (Points : 20)

(TCO 9) Explain which is more appropriate for writing a menu program: a switch case or if-else statements. Provide a snippet of code to support your position. (Points : 15)

(TCO 11) Explain how a linear search is conducted to find a particular data value in an array. Provide a C++ program segment to illustrate your answer. (Points : 15)

(TCO 7) Explain the difference between an argument and a parameter. Use a C++ program segment to illustrate your answer.(Points : 15)

(TCO 5) Using a loop, write a program that adds and displays the total of all even integers from 1 to 10. (Points : 15)

(TCO 4) What is the advantage of using the conditional operator? (Points : 15)

(TCO 3) Explain the naming rules for creating variables and then provide three examples using the data types int, double, and char and assign values to them. (Points : 15)

CIS 170C Final Exam

DeVry