How many time is the loop body of the while statement

Assignment Help Basic Computer Science
Reference no: EM13208038

Assume that all variables are of type int. z = 0; g = 0; s = 0; i = 0; while (i < 50){ scanf ("%d", &t); s = s + t; if (t >= 0) g = g + 1; else z = z + 1; i = i + 1; } 1.How many time 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 2.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 3.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 4.The loop can best be categorized as a .......... a) counter-controlled loop, b) sentinel-controlled loop, c) loop that computes a product, d) general condition loop, e) non of the above

Reference no: EM13208038

Questions Cloud

Prepare a pro forma combined balance sheet : Prepare a pro forma combined balance sheet using purchase accounting. Note that Pierson pays $180 million in cash for Drew where the cash is obtained by using long term debt.
Find the optimal solution of the objective function : a. Find the optimal soulution using the graphical soulution procedure and the value of the objective function b. determine the amount of slack or surplus for each constraint  c. suppose the objective function is changed to max 5A+2B.
Anticipatory metacommunication : Evaluate your current skill levels for each of the three kinds of metacommunication using the scale "good," "fair," and "poor." related to anticipatory metacommunication.
Compute the number of theoretical plates n in the column : Calculate the number of theoretical plates N in the column of length L in 17 cycles. The observed resolution is 1.51.Now, calculate the plate height in the column in ?m.Estimate the resolution in 2 cycles
How many time is the loop body of the while statement : 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; } 1.How many time is the loop body of the while statement executed?
How to determine the amount of goodwill : Explain how the method of accounting for business combination affects whether goodwill is reported and if goodwill is recorded, explain how to determine the amount of goodwill.
Analysis of variance discussion : Discuss which analysis of variance should be applied when an experiment has more than one independent variable. Discuss the assumptions and limitations of the analysis of variance in comparison with the t test including a discussion of post hoc tests..
Explain what is the plate height of the column : How many theoretical plates does the column have What is the plate height (in mm) of the column if the column is 11.7 cm long
At what value of k the monopoly is indifferent : Durable goods pricing. Consider the example discussed in class. The monopoly sells two units of goods over two periods. The costs are zero. Consumer A has a valuation of 15 and Consumer B has a valuation of 10. Suppose the discount rate is f=.8.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Solve the following problems using linearity of expectation.

Solve the following problems using linearity of expectation. . (For each problem you will want to think about what the appropriate random variables should be and define them explicitly.)

  Evaluate archiver-s method opitmally

You've been hired as the outside consultant to evaluate archiver's method, in part as company is interested in automating this phase of process. Is archiver's method optimal?

  Explaining it solutions to enhance workflows

The final method to include IT is not to go "looking for IT solutions" just for sake of using IT. But to have IT at the table to truly think about ways to develop workflows.

  Provide permission to get financial amounts

System to have employees register and provide permission to get financial amounts from dental insurance and retirement companies.

  Wish to represent an n-vertex graph

Suppose we wish to represent an n-vertex graph G using the edge list structure, assuming we identify the vertices with the integers in the set {0,1,...,n?1}.

  Capacity as a systems analyst

In your capacity as a systems analyst, you may face situations in which you encounter an ethical dilemma. For example, you may be asked to design a system that supports an activity with which you personally disagree

  Explain use of compensatory substituent in identification

Explain the use of "compensatory substituent" in identification and annotation of non-coding genes? Write down the difference between matrix and a Blosum60 Blosum20 matrix?

  Describe why analyst needs to understand how people think

Describe why an analyst requires to understand how people think, how they learn, how they react to change, how they communicate, and how they work.

  Describe how to develop users for sales organization unit

Describe how you would develop users for sales organization unit and how you can set up work groups in this particular situation.

  What is ntp and what are clock strata

 What is UTC and why is it used and what is NTP and what are "clock strata"?

  More registers appears to be a good thing

More registers appears to be a good thing, in terms of reducing the total number of memory accesses a program might require. Using the arithmetic expression S = (A+B)-(C+D)

  Message exchange patterns in soap

Let two main types of message exchange patterns in SOAP (and operation types in WSDL): (1) request-response and (2) one-way.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd