Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a C++ simulation program that deals with fleas jumping in a grid. A loca

ID: 3551442 • Letter: T

Question

This is a C++ simulation program that deals with fleas jumping in a grid.


A local government organization has been testing a new biological triggering device. The actual cost has gotten out of hand and they have recruited you to test the new style trigger through 'simulation'. How does the trigger work? The trigger device is a 20 by 20 grid where each square is a sensor. Each square in the grid starts with one flea. (The flea is the biological part) All the fleas jump and land on a neighboring square or the current square which leaves some squares blank or without a flea. Some squares will then have more than one flea. The fleas continue to jump and at some point when 75% of the squares are blank (no fleas) the trigger is fired. If the flea jumps o ff the 20 x 20 grid, the flea is zapped and will no longer be able to jump. Flea lost was the big cost over run the government was having doing real simulations. To simulate the process, we need to know which way the flea will jump. A flea will only jump to a neighboring square and never two or more squares over. Now after much research, it was determine which direction a flea will jump. There are nine places a flea can land, the neighboring square or the square the flea is currently jumping from. A flea will jump in one o f the comer squares 5% o f the time. Each corner is 5%. The top, bottom, left and the current square the flea will jump in 15% o f the time and to the right 20% of the time. 20% direction is the way the dogs hair grows and the fleas jump with the hair a little more often than in the other directions. A flea is in the middle square and the directions the flea will jump are shown below. 5 15 5 15 15 20 5 15 5 A simulation consists of setting one flea on each square then letting the fleas jump. After each jump check to see if 75% of the squares are empty. If they are not, then let each flea jump again. You continue letting the fleas jump until 75% o f the squares are empty and the simulation stops. Now since jumping is random movements, you will need to run the simulation again and again to get an average. You will run the simulation 1500 times and then compute the following information. Inputs: None Outputs: 1. How many times w ill the fleas jump before the trigger is fired? If fleas jumps 5 times every 8 seconds, how much time does one have to clear the area before the trigger is fired? What were the shortest time and the longest time in all simulation that were needed to clear the area? How many fleas on the average were lost before the trigger was fired? (This is to show the government the cost savings for using simulation rather than the real fleas.) Restrictions: Use 2-d arrays(2). Run the simulation 1500 times to generate the results. Output: Format output in a readable style.

Explanation / Answer

Please rate


Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote