CIS 170C Programming with Lab Course

$61.00

CIS 170C Programming with Lab Course
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through

 

Description

CIS 170C Programming with Lab Course

CIS 170C Programming with Lab Course

A+ iLab Week 1-7| Quiz Week 1-7| Discussions Week 1-7| Final Exam

iLab Week 1-7 

https://www.hiqualitytutorials.com/product/cis-170c-all-ilabs/

iLab Week 1 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-1/

Scenario and Summary

Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.

In general, this lab will instruct you on:

  1. how to create a project;
  2. how to enter and save a program;
  3. how to compile and run a program;
  4. how to, given a simple problem using input and output, code and test a program that meets the specifications; and
  5. how to debug a simple program of any syntax and logic errors.
  1. Deliverables
SectionDeliverablePoints
Part AStep 6: Program Listing and Output15
Part BProgram Listing and Output15
Part CProgram Listing and Output15

CIS 170C Programming with Lab Course

iLab Week 2 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-2/

Scenario and Summary

You will code, build, and execute two programs requiring decisions. The first program will determine the smaller of two numbers input on the screen. The second program will calculate the shipping charge based on the purchase amount input on the screen.

Learning outcomes:

  1. To be able to design program logic using either a flowchart or pseudocode
  2. To be able to define and use data types
  3. To be able to prompt the user for input
  4. To be able to use the assignment statement for calculations
  5. To be able to display output to the console in a formatted manner
  6. To be able to debug a program of syntax and logic errors
  7. To be able to make decisions

Deliverables

SectionDeliverablePoints
Part AStep 7: Program Listing and Output20
Part BStep 7: Program Listing and Output25

CIS 170C Programming with Lab Course

iLab Week 3 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-3/

You will code, build, and execute a program that will use looping to determine the score for a diver based on individual judge’s scores.

Learning outcomes:

Become familiar with the different types of looping structures.

Be able to debug a program of syntax and logic errors.

Be able to use the debug step-into feature to step through the logic of the program and to see how the variables change values.

Deliverables

SectionDeliverablePoints
Lab 3Step 6: Program Listing and Output45

CIS 170C Programming with Lab Course

iLab Week 4 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-4/

You will code, build, and execute a program that simulates the dialing of a phone using functions.

Learning outcomes:

  1. Distinguish between pass by value and reference.
  2. Call functions using &.
  3. Write your own functions using value and reference.
  4. Be able to define and use global named constants.
  5. Be able to debug a program of syntax and logic errors.
  6. Be able to use the debug step-into feature to step through the logic of the program and to see how the variables change values.

Deliverables

SectionDeliverablePoints
Lab 3Step 6: Program Listing and Output45

CIS 170C Programming with Lab Course

iLab Week 5 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-5/

Scenario and Summary

You will code, build, and execute two programs requiring arrays and strings. The first program will determine the average score for a group of players and then determine who scored below average. The second program will convert words in a phrase to pig latin.

Learning outcomes:

  1. To be able to explain the need for arrays in a program
  2. To be able to determine the appropriate array data type to use in a given program
  3. To be able to write a program that implements arrays
  4. To be able to explain the way memory is allocated for arrays in a program
  5. To be able to explain the fact that arrays are objects in C++
  6. To be able to write a program that implements strings

Deliverables

SectionDeliverablePoints
Part AStep 5: Program Listing and Output20
Part BStep 5: Program Listing and Output25

CIS 170C Programming with Lab Course

iLab Week 6 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-6/

Scenario and Summary

You will code, build, and execute an Automated Teller Machine (ATM) Menu Driven Console Application. You will utilize classes in the design of this program.

Learning outcomes:

  1. To be able to explain the need for menus in a program
  2. To be able to determine ways to inplement menus in a Windows console application
  3. To be able to understand the classes and objects used in a Windows console application
  4. To be able to write a Windows console application

Deliverables

SectionDeliverablePoints
Lab 6Step 5: Program Listing and Output45

CIS 170C Programming with Lab Course

iLab Week 7 

https://www.hiqualitytutorials.com/product/cis170c-ilab-week-7/

Scenario and Summary

You will code, build, and execute a program requiring sequential files to create an address database using .txt files.

Learning outcomes:

  1. Continue using a menu system with console applications.
  2. To be able to write a console application
  3. Demonstrate Entering/Appending, storing, and retrieving records.
  4. Be able to write lines of output to a text file in order to create a report.

Deliverables

SectionDeliverablePoints
StepProgram Listing and Output45

CIS 170C Programming with Lab Course

Quiz Week 1-7

https://www.hiqualitytutorials.com/product/quiz-week-1-7/

Quiz Week 1 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-1/

(TCO 2) Which characters make up the Stream insertion operator?

🙂

::

<<

//

(TCO 2) In which namespace can cout and cin be found?

<upstream>

::

Math

Std

(TCO 2) The extension name for a C++ source-code file is _____.

.h

.cpp

.exe

.class

(TCO 2) _____ is/are used to document what a program, function, or statement accomplishes and will be ignored by the compiler.

Source code

Debugging notes

Comments

Output documentation

(TCO 2) Which of the following statement about C++ syntax is true?

Every executable statement must end with a comma.

A block is enclosed inside parentheses.

C++ is not case sensitive.

C++ is case sensitive

(TCO 1) Microsoft Visual C++ is an example of a(n) _____.

C++ programming language

Debugger

Compiler

IDE

(TCO 2) Which of the following statements will output “Hello World”?

Cout

Cin

Print Queue

Print Line

(TCO 2) To assign a value 1 to variable x, you write _____.

x++;

1 = x;

x = 1;

x == 1;

(TCO 3) What is the value of x after the following statement?

float x;
x = 3.0 / 4.0 + 3 + 2 / 5

1.75

3.75

5.75

4.15

(TCO 2) The amount of storage size of an integer data type is _____.

32-bit signed

64-bit signed

128-bit signed

256-bit signed

(TCO 3) Explain the essential aspects of a C++ program (include directives, using statements, and the main function) that outputs a line of text to the console. Create an actual example of this C++ program and make sure it does not contain errors.

CIS 170C Programming with Lab Course

Quiz Week 2 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-2/

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

Pseudocode

Algorithm

Program control

Data flow

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

Square

Rectangle

Rectangle

Diamond

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

The if statement contains three parts. The first part is a keyword that tells the computer that it’s an if statement. The second part is a boolean expression. The third part is a statement or group of statements.

You must always surround a single statement after an if with curly braces.

You must always match an if with an else.

An else must always be associated with an if, and vice versa.

(TCO 4) Which one of these symbols is a logical operator?

II

III

IIII

IIIII

(TCO 4) A condition is a _____ statement.

Relational

Boolean

Logical

Mathematical

(TCO 4) The _____ of a variable is limited to the block in which it is declared.

Branching ability

Scope

Associativity

Precedence

(TCO 4) When a program lets the user know that an invalid choice has been made, this is known as _____.

input validation

output validation

compiler criticism

None of the above

(TCO 4) Consider the following segment of code:

if(apple != Orange)
cout<<“You got Oranges!”<<endl;
else
cout<<“You got Apples”;
cout<<“The end of the program is reached.”;

What error can you identify?

A double quotation mark was incorrectly inserted.

You cannot compare apples to oranges.

Assumes indentation has a logical purpose

No error

(TCO 4) Which of the following is true about if statements and switch statements?

They are both selection structures.

The if statement allows for complicated condition checking, and the switch does not.

Switch case can be used when you have a limited number of choices.

All of the above

(TCO 6) If there are errors in the executable code and it needs to be run one step at a time to find the errors, what development tool should be used?

Compiler

Debugger

Linker

Common language runtime

(TCO 4) Mention at least four mistakes that are easy to make when you are first learning how to use selection statements.

Quiz Week 3 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-3/

(TCO 5) Looping statements follow the _____ structure.

Sequence

Control

Selection

Repetition

(TCO 5) When should a programmer select a for loop for his or her program?

When the programmer knows the exact number of times the loop will be executed.

When the programmer knows the loop must be executed at least once.

When he or she is not sure how many times the loop will be executed.

There is no reason to select a for loop. Any loop can be used any time.

(TCO 10) An error that results from a poorly planned solution would be called a _____.

Syntax error

Logical error

Typing error

Debugging error

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

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 a(n) _____.

Nested loop

Infinite loop

Pretest loop

Posttest loop

(TCO 5) Which of the following does counter-controlled repetition require?

An initial value

A condition that tests for the final value

An increment or decrement by which the control variable is modified each time through the loop

All of the above

(TCO 5) A loop that completely contains another is a(n) ____ loop

Outer

Inner

Nested

Covering

(TCO 5) How many times will this for loop execute? 

for(int i = 0; i < 10; –i)

Zero – the loop will not execute

Nine

10

It is an infinite loop

(TCO 5) The segment of code shown below displays “Hello!” _____ times.

int count;
const int NUM_LOOPS = 5;
count = 0;
while( count < NUM_LOOPS)
{
cout<< “Hello!” <<endl;
++count;
}

Zero

Four

Five

Six

(TCO 5) Which of the following for loop is invalid?

for(int i=1, j=10; i<=5; i++;j–)

for(int i=1; i<=5;)
{++i;}

for(int i=1, total=0; i<=5; i++)

int i=1;
for(; i<=5; ++i)

All of the above

CIS 170C Programming with Lab Course

(TCO 5) Using a loop, write a program that reads in exactly five integers and outputs the sum.

Quiz Week 4 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-4/

(TCO 7) A function’s arguments and variables are stored in an area of memory known as the _____.

Rack

Stack

Pack

Nill

(TCO 8) A value included in a function call that is passed to a function is called a(n) _____.

Parameter

Argument

Initializer

Reference

(TCO 7) Arguments and parameters must match in _____.

Data type

Numbers of parameters

The order of parameters

All of the above

(TCO 7) What is wrong with this call statement?
PrintName(string name);

It is missing void.

The data type should be removed.

The semicolon should be removed

Nothing is wrong with it.

(TCO 7) A variable’s visibility indicating where in the program the variable can be used is called _____.

Lifetime

Scope

Local variable

Global variable

(TCO 7) Why is it not necessary to pass a global variable to a function?

You have to pass global variables to functions

main () passes them for you

All functions defined after the global variable definition can see and access global variables

They remain local to main().

(TCO 8) Which function prototype indicates the parameter is passed by reference?

int myFunction( double &)

int myFunction(double)

int myFunction(double *)

int myFunction(&)

(TCO 8) C++ provides _____ to avoid function calls

Avoid function calls

Call function stalls

Inline functions

Inline variables

(TCO 7) What is wrong with this code?

int Money4Me( int dollars )
{
int pennies, coins;
coins = dollars * 100;
}

The function name is invalid

Missing a semicolon on the first line

Missing a semicolon on the first line

There is no return statement

(TCO 7) What is the purpose of the function prototype?

Declares variables that need to be used

Provides the compiler with function information

Allows the function to be called

You don’t always need a prototype

CIS 170C Programming with Lab Course

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

Quiz Week 5 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-5/

(TCO 11) What is the value of the subscript for the first element of an array?

Undefined

1

0

Determined by the declaration of the array

(TCO 11) Which of the following technique can be used to process the elements of a single-dimensional array?

Selection structure

Looping structure

Sequence structure

None of the above

(TCO 11) Given myArray[1][5], the number 5 refers to a _____.

Row

Column

Row and a column

None of the above

(TCO 12) Given the following array:

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

The following statement would replace which value?
profit [0] = profit[2];

10 with 31

10 with 20

20 with 31

10 with 55

(TCO 12) In the variable initialization: char course[20] = Welcome to CIS170C ; the character at course[6] will be _____.

\0

The letter m

The letter e

A space

(TCO 11) In the following table, what is the value of table[2][1]?
int table[3][4]={3,7,0,2,4,9,8,1,3,6,5,4};

4

7

6

1

(TCO 11) What type of error will this code produce?

int n[10], i;
for(i = 0; i < 10; ++i)
n[i] = i;

No compiler errors will be reported

A compiler error is generated since there are no braces {} with the for loop.

A runtime error may occur because we are out of bounds on the array.

A compiler error is generated since there are no braces {} with the for loop, AND a runtime error may occur because we are out of bounds on the array.

(TCO 11) Is it possible to write code in this manner for a C++ program?

char auto;
cout << “what kind of automobile do you have?”;
cin >> auto;
char cars[auto];

Yes, this is perfectly acceptable C++ code

No, the array dimension cannot be a variable

The compiler would report that there is an illegal use of a keyword.

Yes, this is perfectly acceptable C++ code, but the comopiler would report that there is an illegal use of a keyword

(TCO 11) What is wrong with this code?

void WriteDay(char d[]);
int main( )
{
char Day [10] = “Friday”;
WriteDay(Day[]);
return 0;
}

The brackets are not needed in the call statement

Friday is too short for the array

The code is correct as written

The call statement should be written as WriteDay(Day[10]);

(TCO 12) Assuming that t is an array and tPtr is a pointer to that array, which expression refers to the address of element 3 of the array?

*( tPtr + 3 )

tPtr[ 3 ]

&t[ 3 ]

*( t + 3 )

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

Quiz Week 6 

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-6/

(TCO 9) Menu-driven programs should be broken down into _____ that perform individual tasks.

Loops

Functions

Tasks

Modules

(TCO 9) The items displayed in a menu are often preceded by _____.

a number

a letter

other characters

Any of the above

(TCO 9) A(n) _____ represents an entity in the real world that can be distinctly identified.

Class

Function

Object

Method

(TCO 9) The procedures that the object performs are known as _____.

Records

Functions

Addresses

Data fields

(TCO 9) The class _____ starts with the word “Class” followed by the name of the class.

Body

Definition

Return

Members

(TCO 9) You should declare a data field private by using the _____ keyword.

Clandestine

Concealed

Private

Data fields cannot be private

(TCO 9) What has exactly the same name as the defining class?

Constructor

Inheritance

Accessor

Polymorphism

(TCO 9) Which of the following is not true of a constructor and destructor of the same class?

They both have the same name aside from the tilde (~) character.

They are both usually called once per object created.

They both are able to have default arguments.

Both are called automatically, even if they are not explicitly defined in the class.

(TCO 9) Member access specifiers (public and private) can appear _____.

In any order and multiple times

In any order (public first or private first), but not multiple times

In any order and multiple times if they have brackets separating each type

Outside a class definition

(TCO 9) Which of the following is correct?

A constructor must be declared for each class.

A constructor must be declared with a return type.

A constructor must be declared with a return type.

A class can have only one default constructor.

(TCO 9) Explain what a default constructor is and why it is used. Provide code segment to illustrate a simple class, create a constructor method to intialize a private property, and demonstrate how an object would be instantiated with your constructor.

Quiz Week 7

https://www.hiqualitytutorials.com/product/cis170c-quiz-week-7/

(TCO 13) _____ are files to which data is written.

Output files

Input files

Active files

Sequential files

(TCO 13) When storing and retrieving data, a sequential access file is much like a _____.

Floppy disk

Book

Hard disk

VCR tape

(TCO 13) When reading data from a sequential file, the data will be _____.

Read in alphabetical order

Sorted from smallest to largest

In key field order

In the order in which it was written

(TCO 13) To create an output file object, you would use what kind of type?

Ifstream

Ofstream

Fstream

Instream

(TCO 13) What do the following statements accomplish?
ifstream theFile;
theFile.open( myFile.txt , ios::in);

Opens myFile in read mode

Opens myFile in append mode

Creates an empty file named myFile

Opens a file in input mode to write to

(TCO 13) When a file is opened in output mode, the file pointer is positioned _____.

At the end of the file

At the beginning of the file

In the middle of the file

After the file header

(TCO 13) Which of the following functions should be used to determine if a file was successfully closed?

is active

is active

is active

is active

(TCO 13) What is the data hierarchy arranged from largest to smallest?

File, field, record, byte, bit

File record, field, bit, byte

File, record, field, byte, bit

Record, file, field, bit, byte

(TCO 13) Given the following declaration:
ifstream theFile;
When using a loop to read lines from a sequential file, what would be the proper loop condition?

while (!theFile.eof())

while (theFile.eof == true)

while (theFile !eof)

while (theFile.eof != false)

(TCO 13) Which of the following is not true about files?

C++ views each file as a sequential stream of bytes.

Files are opened by creating objects of stream classes.

Member functions of stream objects can be applied to file streams

istream, ostream, and iostream are derived from ifstream, ofstream, and fstream, respectively

(TCO 13) Explain how the end-of-file method is used when reading data from a sequential file. Provide a C++ code segment that reads data from a text file using a while loop.

CIS 170C Programming with Lab Course

ALL Discussions Week 1-7

All Students Posts 238 Pages

https://www.hiqualitytutorials.com/product/cis-170c-all-discussions/

Basic Programming Constructs Discussions Week 1 All Students Posts 19 Pages 

https://www.hiqualitytutorials.com/product/cis170c-basic-programming-constructs/

Let’s preview some basic programming constructs of the C++ language before going on to discuss them in more depth in the following weeks. The basic constructs include preprocessor directives, comments, declarations and definitions, statements, expressions, and functions. What are preprocessor directives and how do we use them in our program? Specifically, in getting started with thread 1, what are some of the basic constructs for a C++ program?  How can you create a program that prints Hello World in Visual Studio C++?…

Lab Forum Discussions – 14 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. What concepts apply to this week’s lab assignment?   What questions do you have about this week’s lab? …

Selection Structures Week 2 All Students Posts 21 Pages 

https://www.hiqualitytutorials.com/product/cis-170c-selection-structures/

Selection structures, also called the decision structures, are one of the three basic control structures. You can hardly write a few statements of code without bumping into the need to take alternative programming paths based on some condition. What two types of operators are available to us to create Boolean expressions so that we can make decisions in our programs? Provide an example of each using correct C++ syntax.  What is a decision statement? Why are they used? What is the syntax of a decision statement? Give some real life examples of decisions. Give some C++ examples….

Lab Forum – 12 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students….

Repetition Structures Week 3 All Students Posts 14 Pages 

https://www.hiqualitytutorials.com/product/cis-170c-repetition-structures/

Selection structures play a very important role in programming; however, they cannot do the job alone. In every program, we deal with the situation when we have to repeat the same sequence of statements for different customers, transactions, online clients, and so on. What kinds of structures are required for these tasks? What are the major differences among these structures? While not all programs require the use of a repetition structure, what types of programs could, and should, utilize a repetition structure? Could you come up with an example first?…

Lab Forum -13 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. Let us discuss the break statement first. You have seen the use of it with switch statements. Can you explain what the use of it is? Is any there any other place where you have used it?….

Why Use Functions Week 4 All Students Posts 19 Pages 

https://www.hiqualitytutorials.com/product/cis170c-why-use-functions/

Based on what you learned this week, what are the benefits of creating a modular design for a large computer program? Why would one extremely large program not be the best choice for a quality program design? Please provide an example of a simple function and be sure to illustrate the basic components required to create a function in C++….

Lab Forum – 13 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. What is an example of a function parameter?  What is an example of a function argument?  Are either required to create functions?…

Use of Arrays Week 5 All Students Posts 19 Pages 

https://www.hiqualitytutorials.com/product/cis-170c-use-of-arrays-and-lab-forum-discussions-week-5-devry/

Let’s start with the basics: What is an array? What is it useful for? How do you describe the various parts of an array? What are some C++ examples of defining an array?…

 Lab Forum – 15 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. In working with your week 5 lab how can an array be incorporated?  What is the syntax for using an array in C++?

Classes and Objects Week 6 All Students Posts 20 Pages 

https://www.hiqualitytutorials.com/product/cis-170c-classes-objects/

The goal of introducing classes is to render support to the practices of object-oriented programming and eliminate the drawbacks caused by using smaller units of modularity: functions. The primary goal of the class construct is to bind together data and operations into one syntactical unit, and to indicate that these coding elements belong together. What are classes and objects? What is the relationship between them? Please provide a real-world example that demonstrates this relationship.  Can you provide an example of an object and an instantiation in C++?…

 Lab Forum – 23 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. What are the benefits of overloading constructors?…

File Processing Week 7 All Students Posts 20 Pages 

https://www.hiqualitytutorials.com/product/cis-170c-file-processing/

What is a file? Why is it necessary to “open” and “close” a file? What happens when we do that?  What is a file stream and how does that relate to a sequential file?…

 Lab Forum – 16 Pages 

This discussion is used to discuss the programming labs and techniques. Post any programming questions or hints and tips on this week’s programming lab. At a minimum, post at least three notes that highlight the key programming techniques, problems you had with this week’s lab, or help to other students. What are the menu choices? Does the switch statement use integers or characters? What kind of loop should we use? What does the grading rubric tell you about this function?…

Final Exam 

https://www.hiqualitytutorials.com/product/cis-170c-final-exam/

(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 Programming with Lab Course

DeVry