Write a program to determine the length of bursts of zero

Assignment Help Basic Computer Science
Reference no: EM132184081

Write a program to determine the length of bursts of zero's in a list of N numbers stored in an List. The program should record the length of the bursts of zero's in another List. The program should then print the lengths of the bursts.

Using this second List with the lengths of the bursts, it should also compute and print the following: the average length of the bursts, the minimum burst length, the maximum burst length, and the total number of zeros (the sum of the burst lengths). 

Your program should:

1. Prompt the user for the size of the list (N). Then it should prompt the user to enter N numbers and store them into an list called burstList. Note, you should specify the maximum size of N allowed (based on how large you declare your List).

2. Given N and list, your program should compute the lengths of the bursts of zeros and store them in an list called BurstLengths. After computing and storing the burst lengths you should terminate your BurstLengths list with a sentinel (-1). Use a for loop in this step.

3. Given the BurstLengths List with a sentinel (-1), use a while loop to print the list of burst lengths. Format this nicely in a table with headings.

4. Given the BurstLengths List with a sentinel (-1), compute and then print the following information:

a. Average burst length

b. Minimum burst length

c. Maximum burst length

d. Total number of zeros

Reference no: EM132184081

Find the representation of leslie in concept space

Find the representation of Leslie in concept space. What does that representation predict about how well Leslie would like the other movies appearing in our example data?

Pounds of pecans should you mix

A store sells cashews for $3.00 per pound and pecans for $8.00 per pound. How many pounds of cashews and how many pounds of pecans should you mix to make a 50 Lb mixture co

What do you recommend he do about making a backup

What do you recommend he do about making a backup - The chief financial officer (CFO) of NCWR keeps a huge number of reports, spreadsheets, and other critical financial infor

Create a business proposal to select

Your company is now looking to potentially adopt a new operating system. You have been asked to create a business proposal to select a suitable operating system, describe it

Plan the logic for an insurance company''s premium

Modify Exercise 7a. so that the second method calls one of two additional methods-one that determines the health premium or one that determines the auto premium. The health

Draw a map showing the interactions

The landlord has a number of alternatives for increasing his profits (attracting more customers, increasing prices, getting customers to spend more etc.) but each of these l

Describe the major components of a datawarehouse

Briefly describe the major components of a datawarehouse architecture. Explain how the volatility of a datawarehouse is different from the volatility of a database for an op

Returns an array with the dimensions

You are to write a class called Matrix that implements a constructor, a method to returns an array with the dimensions of the stored matrix, a method that returns a referenc

Reviews

Write a Review

 
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