Chat with us, powered by LiveChat DEVRY CIS170B WEEK 3 quiz | Writedemy

DEVRY CIS170B WEEK 3 quiz

DEVRY CIS170B WEEK 3 quiz

Question

Question 1. Question :

(TCO 5) When writing a program, if you know exactly how many times statements in a loop should execute, use the _____ structure.

do while

for

goto

while

Instructor Explanation: With the FOR structure, the programmer specifies the number of iterations the loop will perform.

Points Received: 4 of 4

Comments:

Question 2. Question :

(TCO 5) When used within a loop structure, the _____ statement causes execution to jump out of the loop and proceed with subsequent statements in the program.

break

continue

goto

jump

Instructor Explanation: BREAK breaks completely out of the loop whereas CONTINUE transfers control to the loop’s conditional expression.

Points Received: 4 of 4

Comments:

Question 3. Question :

(TCO 5) A block of statements within the body of a FOR loop must be surrounded with _____.

curly braces {}

parentheses ()

square brackets []

None of the above

Instructor Explanation: Although a loop body containing a single statement needs no braces, several statements must be surrounded with curly braces.

Points Received: 4 of 4

Comments:

Question 4. Question :

(TCO 5) What output will this set of statements produce?

int a = 1;

while (a < 1)

{

Console.Write(“{0}\t”, a);

a++;

}

Console.Write(“{0}\t”, a);

An infinite loop

An exception

1

1 1

Instructor Explanation: Because “a” will never be less than 1, the WHILE loop will not execute. The value of “a” will remain 1.

Points Received: 4 of 4

Comments:

Question 5. Question :

(TCO 5) In this code, the inner FOR loop _____.

int i = 1, j = 1;

for (i = 1; i < 4; i++)

{

for (j = 1; j < 4; j++)

{

Console.Write(“{0}{1} “, i, j);

}

}

contains a syntax error

is nested

is like a blue sky

is like a light

Instructor Explanation: The inner FOR is nested inside the outer FOR, so for every execution of the outer FOR, the inner FOR will execute three times.

Points Received: 4 of 4

Comments:

Question 6. Question :

(TCO 5) Your program keeps asking for last names from the user until he/she enters “####.” In this context, the “####” is used as a(n) _____.

accumulator

counter

sentinel value

test value

Instructor Explanation: A sentinel value is a dummy variable not used for processing. It’s used to signify when a loop should stop executing.

Points Received: 4 of 4

Comments:

Question 7. Question :

GOTO statements should be avoided.

True False

Instructor Explanation:

Yes, since they are often result in unstructured and confusing code. Break and Continue is a much better choice.

Note that GOTO usually works with a Label.

Points Received: 4 of 4

Comments:

Question 8. Question :

A walkthrough is a form of software peer review the programmer leads members of the development team through the software code, and the participants ask questions and make comments about possible errors, problems of not adhering to development standards, and other problems.

True False

Points Received: 4 of 4

Comments:

Question 9. Question :

Accumulators and counters mean the same thing.

True False

Points Received: 4 of 4

Comments:

Question 10. Question :

Nesting or indenting multiple programming loops is a good coding practice.

True False

Points Received: 4 of 4

Comments:

Question 11. Question :

The For Loop is used when the user wishes to stop the Loop from executing, and is used when the number of Loop Executions is unknown.

True False

Points Received: 4 of 4

Comments:

* Times are displayed in (GMT-07:00) Mountain Time (US & Canada)

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order