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

  Pseudocode for a program to solve mathematical problem

Pseudocode for a program to solve the following problem. A student borrows $3,000 at an interest rate 2% per month on the unpaid balance.

  Develop the algorithms needed for designer robot

You have been hired as a system designer to develop the algorithms needed for a designer robot that can paint different patterns on the floor based on the commands it receives.

  Write the code required to analyse and display

Engineer for a materials manufacturing research lab and have been asked to provide an automated solution to analyse data.

  Write program to prompt user to enter string of caharacter

Write a program that prompts the user to enter a string of 87 characters the program should display the middle character in the string if there is an odd number characters in the string.

  Program that uses for loop prompt user to input two integers

Write a program that uses for loop to preform the following steps: Prompt the user to input two integers: firstnum and secondnum.

  Program to create new departments to sustem

An ability to add new departments to system. The program should permit you to create new departments. Each department has a name, and a location (e.g. "Sydney" or "Tokyo").

  Html/css

"Validating Your Work" Please respond to the following:  Describe attribute minimization. Explain what would happen if you tried to validate a page containing instances of attribute minimization. Propose a solution to this problem.

  C program to accept three numbers inputs by user

Write down C program to accept three numbers input by a user, and outputs a table of temperatures in Fahrenheit, Celsius, and Kelvin.

  Examine the boxplot

Examine the boxplot and briefly discuss the overall pattern of electricity usage for the households.

  Program to compute person earns in a month

Write a program that calculates how much a person earns in a month if the salary is one penny the first day, two pennies the second day, four pennies the third day.

  Application to convert kilometers in miles

Application will input number of kilometers, compute number of miles, and display number of miles. You will use a constant to store the kilometers-to-miles conversion factor.

  Design class named loan that holds account number

Design a class named Loan that holds account number, name of account holder, amount borrowed, term, and interest rate. Include methods to set values for each data field.

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