Implement class to simulate growth of roach population

Assignment Help Programming Languages
Reference no: EM1358756

Implement a class RoachPopulationthat simulates the growth of a roach population. The constructor takes the size of the initial roach population. The breed mutator method simulates a period in which the roaches breed, which increases their population by a multiplicative factor chosen randomly and in the range [1.5, 2.5]. The spray mutator method simulates spraying with insecticide, which reduces the population by a percentage chosen randomly and in the range [5, 25] (i.e., the number of roaches is reduced by somewhere between 5%-25%). Implement an accessor method to return the current number of roaches. A program called RoachSimulation simulates a population that starts out with n roaches, where n is chosen randomly in the range [25,100]. An iteration of the simulation is made up of the tree steps: breed, spray, and display the size of the roach population. Before starting any of the simulation iterations be sure to display the initial number of roaches in the population. The entire simulation consists of completing 10 iterations (or until the roach population has reached 0).

Reference no: EM1358756

Questions Cloud

Challenges in risk management : Challenges in Risk Management - Examine the role of the risk manager in integrating the risk management program within the organization and ensuring compliance.
Choose an mne with which you are familiar and determine : Choose an MNE with which you are familiar and determine which staffing approach would be most beneficial to that enterprise.
Find out the force exerted by the rope on the bucket : A 51 crate, starting from rest, is pulled across a floor with a constant horizontal force of 250 . For the first 11.5 the floor is frictionless, and for the next 11.5 the coefficient of friction is 0.16. what's the final speed.
What occurs when monetary authorities sell government : Which of the following best describes what occurs when monetary authorities sell government securities.
Implement class to simulate growth of roach population : Implement a class RoachPopulationthat simulates the growth of a roach population. The constructor takes the size of the initial roach population.
Value of your enterprise technology : Discuss your opinion about the value of your enterprise technology example and if you think it appropriately addressed optimal management of the value chain.
Outsourcing and globalization : Outsourcing and Globalization - Can you provide descriptions of at least three implications of outsourcing and/or globalization for public and/or nonprofit managers and leaders.
Cognitive impairment dementia : A description of the cognitive impairment Dementia and the psychological disorder according to the DSM IV TR .
Determine financial information systems : Determine what kind of financial information systems will you use when you start your "mail packaging and supplies" business? Explain why would you choose this type of systems?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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