Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions 1-4 refer to the following program segment. Assume that all variables are of type int. z=0; g=0; s=0; i=0; while (i =0) g=g+1; else

image text in transcribed
Questions 1-4 refer to the following program segment. Assume that all variables are of type int. z=0; g=0; s=0; i=0; while (i =0) g=g+1; else z=z+1; i=i+1;} How many times is the loop body of the while statement executed? a. once b. never c. 49 times d. 50 times e. until a number 50 or larger is entered The value stored in variable s at the end of the execution of the loop could best be described as ___. a. the average of the numbers scanned b. the sum of the numbers scanned c. the largest of the numbers scanned d. how many numbers were scanned e. the sentinel value The value stored in variable z at the end of the execution of the loop could best be described as ___. a. how many positive items were scanned b. the sum of all positive items scanned c. how many negative items were scanned d. the sum of all negative items scanned e. 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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

14.10. Verify the expected mean squares given in Table 14.1.

Answered: 1 week ago