Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me answer these C#, Thanks 1)The most appropriate sentinel value that might be selected for month of the year is ____. A)0 B)1

Please help me answer these C#, Thanks

1)The most appropriate sentinel value that might be selected for month of the year is ____.

A)0

B)1

C)6

D)12

2)Which of the following is an advantage of a sentinel-controlled loop?

A)The number of iterations does not have to be known.

B)An extreme or dummy value can be entered.

C)The loop is always performed at least one time.

D)It could be used with the while form of the loop.

3) for (int i = 0; i < 10; i++)

{

Console.WriteLine(counter + i);

}

The variable i defined in the program segment above ____.

A)is out of scope when the loop terminates

B)creates an error because it is changed in the update portion

C)would have a value of 10 if it were printed on the outside of the loop

D)can be displayed prior to the loop program statements

4)for (int i = 0; i < 5; i++)

Console.Write(i + \t);

The conditional expression used with the for statement ____.

A)must involve a counter

B)must evaluate to false in order for the loop body to be executed

C)is evaluates after the loop body is performed once

D)is written following the first semicolon

5)The only posttest loop structure available in C# is _____.

A)while

B)for

C)do...while

D)foreach

6) int loopVariable = 0;

do

{

Console.WriteLine(Count = {0:}, ++loopVariable);

}while (loopVariable < 5);

How many times will be loop body be executed if the conditional expression is changed to (loopVariable == 5)?

A)0

B)4

C)5

D)6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions