Determine the length of bursts of zero

Assignment Help Basic Computer Science
Reference no: EM132186061

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: EM132186061

Questions Cloud

How you believe the program will help you achieve your goals : Describe the purpose of the Bachelor of Science in Health Administration (BSHA) program. Describe how you believe this program will help you achieve your goals.
Discuss the firm competitive and supply chain strategies : BUS 4843 SUPPLY CHAIN STRATEGY AND MANAGEMENT PROJECT - Briefly discuss the firm's competitive and supply chain strategies
What is network address translation : What is Network Address Translation (NAT)? Why would a company utilize it? Would it be more typical for a small, medium, or large company to use NAT?
Write a shell script called numopt : 1. Write a shell script called numopt.sh to accomplish the following
Determine the length of bursts of zero : 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
Accountable care organizations may require organizational : Accountable care organizations may require organizational structures that
Describe how the company was breached : Read the NPR article titled "Uber Pays $148 Million Over Yearlong Cover-up of Data Breach" which can be found at Uber_Breach.
Positional bargaining approach-hold fast to store policy : Offer your opinion on whether or not Joe should take a positional bargaining approach and hold fast to the store’s policy.
Was it technology that drove this change or was it business : Information technology has changed business as companies compete globally and are pressured to provide quality, speed, and customer service.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Number of laptops per quarter sold by a computer

The number of laptops per quarter sold by a computer outlet in a suburb was recorded, for three consecutive years from 2011 to 2013

  What is the probability that on a selected day the stock

What is the probability that on a selected day the stock price is between $155.71 and 159.48?

  Evaluate the firm strategy

As owner of a local, independent supermarket, explain how you would evaluate the firm's strategy.

  Assignment engages the student in understanding

This assignment engages the student in understanding how projects fit as implementation vehicles to meet organizational goals defined within the organization's  strategic plan. Organizational structures can have an impact on projects and portfolio..

  Technical control and an administrative control

Suggest a password policy for No-Internal-Controls. Include an example of a technical control and an administrative control.

  Write out the alias structure for this design

Calculate the range and standard deviation of the free height for each run. Is there any indication that any of these factors affects variability in the free height?

  Worlds biggest data breaches

Use one of your favorite search engines (preferably www.google.com) and search world's biggest data breaches. Select at least two of the major data breaches from the list you found and complete the following.

  Determine which lines of code in compute freqs ()

Determine which lines of code in compute Freqs () are problematic and update the function to handle this situation. Be sure to test your code.

  What is the role of v&v in system vulnerability

Part of the problem in design flaws involves issues associated with software verification and validation (V&V). What is the role of V&V in system vulnerability?

  What is the two-phase locking protocol

What is the two-phase locking protocol?

  Software engineering procedure

Can correctness proving solve the problem that the product as delivered to the customer may not be what the consumer really requires?

  Question regarding the tcp performance

Geoff Huston, "TCP Performance", The Internet Protocol Journal, Vol.3, No.2, June 2000.

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