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

  Write a documented argumentative essay

Write a documented argumentative essay

  List all the events in this space that are independent of e

Show that each event with probability 0 or 1 is independent of every event in its space ? Suppose that S = {a,b,c,d}, all outcomes equally likely, and E = {a,b}. List all the events in this space that are independent of E.

  Jim develops 5 java applications a year

Jim develops 5 Java applications a year. Joe develops 10 Java applications a year. Jim gets paid $5000.00 per application, but Joe gets paid $10000.00 per application.

  How to implement a j-k flip-flop starting with a d flip-flop

Show how to implement a J-K flip-flop starting with a D flip-flop.

  Corporate goal for scr new training activity

We require corporate goal for SCR which refers to new training activity. Create a draft to show Jesse. Draft project scope statement for TIMS system

  Compute trajectories for a satellite launcher

Compute trajectories for a satellite launcher

  How could you encode a problem to work with planning graphs

We saw that planning graphs can handle only propositional actions. What if we want to use planning graphs for a problem with variables in the goal.

  Subroutine that can multiply two 32-bit unsigned integer

The caller pushes the multiplicand into the stack first and then pushes the multiplier. The pointer to the buffer to hold the product is passed in index register X.

  Specify the values for the resistors and capacitor

Specify the values for the resistors and capacitor for a first-order Butterworth lowpass op-amp filter with a dc gain of unity, a corner frequency of 12 kHz, and a dc input impedance of 1000?

  16-bit signed magnitude numbers

Convert the following numbers to 16-bit signed magnitude numbers (display results in hexadecimal):

  What advantages might there be for use of such software

If you were the IS manager for a large manufacturing company, what concerns might you have about your organization using open source software?

  Critically analyze the transmission media

Critically analyze the transmission media you would recommend for each different building and department of the medical instrument company

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