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

  Program to compute percentage and final grade for students

Write a program which will permit teacher to compute percentage and final grade for students in a class.

  Compare three generations of programming languages

Compare and contrast at least three generations of programming languages. Be sure to include in your discussion: semantics, syntax, and machine dependence.

  Program to print chains of numbers within a range

Write a program to print the chains for the numbers within a range that the user specifies.

  Activity for pdus on project management institute-s web site

Several activity categories are given as qualifying for PDUs on project Management Institute's Web site. Recognize  these categories. In which categories would you place Chris's experience?

  Expression whose value is distance between two point

a structured type with two fields, x and y, both of type double-- write an expression whose value is the distance between the two point represented by p1 and p2.

  Create application which permits user to input a price

Create an application which allows a user to input a price until suiatble sentinel value is entered. Output is a price of each item on each day,one through seven.

  Identify entities of web site used for ordering a product

Identify a web site used for ordering a product or service and then identify the various entities. As an example when you go to Amazon.com and review products.

  Create a class named rectangle with length and width

To cover that floor with carpet that costs $8 per square foot would cost $960. (12 x 10 x8 = 960.). You should create a class named Rectangle with the following properties:

  Development of the current strategic potential of airline

Evaluate the organisation's current external and internal strategic position

  Applications in involve computing various powers of e

The transcendental number, e. Many applications in mathematics involve computing various powers of e. It can be proven that ex = 1 + x/1 + x2/2! + x3/3! + ... for all values of x. Of course, this is an infinite sum.

  Write program that uses recursive function to count number

Write a program that uses a recursive function to count the number of blobs in a square grid. Input to the program should consist of the locations of the asterisk in the grid.

  Design application that would output payment coupons

Design the application that would output 12 payment coupons for each of the 15 apartments in each of the 20 buildings. Each coupon should contain the building number.

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