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

  Why computer literacy has become fourth fundamental skill

Explain whether today, computer literacy (knowledge of how to properly use computer and its software applications) has become fourth basic skill.

  Explain diagnosing and troubleshooting excel-based problems

How does versatility of Excel affect application support? Because of its versatility, write assumptions should be made when diagnosing and troubleshooting Excel-based problems?

  Explain whetherucita should or should not be adopted

What are your arguments in support of these points? You really did not answer the question as these don't really explain whether you believe the UCITA should or should not be adopted.

  Create 3 files date.h, date.cpp, date_main.cpp

create 3 files date.h, date.cpp, date_main.cpp that will create a birth date and a graduation date in the form MM/DD/YYYY

  Comma-delimited text file

This is based on a comma-delimited text file that has already been created containing a 3 digit ID # and a first and last name. The last part of the excercise is as follows.

  Client-server computing from file server

Discuss the evolution of client-server computing from file server to multilayer applications to Web-based applications. What has been the driving force causing this evolution? Where do you think network computing will be in the next five years? Ten y..

  Writing viruses-worms and trojan horses

Course taught students how to write viruses, worms, and Trojan Horses. It also explained the history of computer viruses as well as how to block attacks.

  Can be done with primary keys

Explain what can be done with primary keys to eliminate key ripple effects as a database evolves.

  Compute the overall npv if tangible benefits are given

Tangible benefits of $190,000 per year. If the cost of capital is 12 percent, compute the overall NPV? Overall ROI? Break-even.

  Explain how decision problem is decidable

Think of the way to mark all variables A such that for some string x ∈ Σ*, A (⇒*(over)G) x. Describe algorithm in detail.

  Instruction cycle and finding contents of registers

Go over instruction cycle and find out contents of registers PC, AR, DR, AC, and IR for each of seven memory-reference instructions.

  What is the relationship between transistor densities

In two paragraphs explain what is the relationship between transistor densities and the improvement in computer speed and miniaturization?

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