Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 13 With the while loop, the body of the loop is ____. always performed at least one time performed as long as the conditional

QUESTION 13

With the while loop, the body of the loop is ____.

always performed at least one time

performed as long as the conditional expression evaluates to true

must produce a boolean result

must be enclosed in curly braces

none of the above

QUESTION 14

Reviewing the code snippet below, the loop can best be categorized as a: int i = 0, g = 0, s = 0, t = 0, z = 0; string sValue; while (i < 5) { inValue = ReadLine( ); t = Convert.ToInt32(inValue); s = s + t; if (t > ?1) g = g + 1; else z = z + 1; i = i + 1;

}

counter-controlled loop

sentinel-controlled loop

state-controlled loop

flag-controlled loop

none of the above

QUESTION 15

Reviewing the code snippet below, the value stored in variable z at the end of the execution of the loop could best be described as: int i = 0, g = 0, s = 0, t = 0, z = 0; string sValue; while (i < 5) { inValue = ReadLine( ); t = Convert.ToInt32(inValue); s = s + t; if (t > ?1) g = g + 1; else z = z + 1; i = i + 1; }

the number of positive items entered

the sum of all positive items entered

the number of negative items entered

the sum of all negative items entered

the sentinel value

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

Students also viewed these Databases questions

Question

find the polynomial of degree S 6 that interpolates the 7 points

Answered: 1 week ago