1

Write an application using an appropriate language, such as C++ or C#. The application will simulate...

Question

Write an application using an appropriate language, such as C++ or C#. The application will simulate...

Write an application using an appropriate language, such as C++ or C#. The application will simulate a scenario in which objects interact in a virtual environment, while also recording data for later analysis. The scenario is somewhat silly, but the important aspects to focus on are that it works and that data is recorded.


Imagine a world, 20 units wide by 20 units tall, where sentient creatures called splurbills sprout from the ground, one inch tall, and grow to enormous sizes at the rate of one inch per unit of time, never moving from their initial location. Splurbills grow best when they’re not being observed, so their natural enemies in this environment are flying beasts called tablioks. Tablioks have dozens of eyes, and move in linear paths at the rate of one world unit per unit of time. When tablioks encounter a boundary, they adjust their course, essentially bouncing around the 20x20 environment. A tabliok has a visual radius that extends a distance of five units in every direction. When a splurbill is visible to a tabliok, it grows at 50% its normal rate.


Given this scenario, develop an application that places six splurbills at random locations in the world, as well as one tabliok to observe them. Please note that your application does not need to represent these elements visually – they can be “observed” entirely in your computer’s memory! Each simulation should run for one thousand units of time. During the simulation, record the amount of time that each splurbill has spent under observation by a tabliok.


When a simulation ends, the height of each splurbill should be displayed, along with its position (X and Y coordinates) as well as the amount of time it spent under observation.


If it helps, the Linear Path can be diagonal.


Answers

#include<iostream.h>

void main(){

int a[100];

int splurbills=1;

int tablioks;

while((tabiloks!=20*20)&&(splurbills<20)){

tabiloks=3.14*(5^2);

if(tabiloks==splurbills){

splurbills=splurbills+0.5*splurbills;

}

}

//height of splurbills//

cout<<splurbills;

return 0;

}


Similar Solved Questions

1 answers
Upper Division of Lower Company acquired an asset with a cost of $590,000 and a four-year...
Upper Division of Lower Company acquired an asset with a cost of $590,000 and a four-year life. The cash flows from the asset, considering the effects of inflation, were scheduled as follows. Year Cash Flow 1 $ 210,000 2 265,000 3 285,000 4 325,000 The cost of the asset is ex...
1 answers
I will thumbs up the correct answer. Prefer the answer done through Excel, thanks. MGMT FFAC...
I will thumbs up the correct answer. Prefer the answer done through Excel, thanks. MGMT FFAC Ch 5: Exercises Part A. The following information is available for the Entity A: Sales revenue $618,000 Sales returns and allowances 15,000 Sales discounts 5,000 Cost of goods sold 398,000 Operating expe...
1 answers
Rod AB is undergoing general plane motion. Determine the magnitude of the acceleration at point B...
Rod AB is undergoing general plane motion. Determine the magnitude of the acceleration at point B in y 6 m/s? x w = 3 rad/s a A B 2 m 60°...
1 answers
What modern day states can be found in the Louisiana purchase?
What modern day states can be found in the Louisiana purchase?...
1 answers
2. An auditor is trying to figure out if the inventory at an electronics store chain...
2. An auditor is trying to figure out if the inventory at an electronics store chain is obsolete. What characteristics might be used to help establish a model predicting inventory obsolescence?...
1 answers
A voltaic cell consists of a Pb/Pb2+ half-cell
A voltaic cell consists of a Pb/Pb2+ half-cell and a Cu/Cu2+ half-cell at 25 C . The initial concentrations of Pb and Cu are 5.00×10-2 M and 1.50 M ,respectively.What is the initial cell potential, what is the cell potential when the concentration of Cu2+ has fallen to 0.200 V, and what are th...
1 answers
Swinburne University of Technology F&P MTH20013 Linear Algebra & Applications Q.7 3+3+3312 Marks i. Suppose that...
Swinburne University of Technology F&P MTH20013 Linear Algebra & Applications Q.7 3+3+3312 Marks i. Suppose that U is a vector pointing north-west with u -12. nit vector i points towards the east and the unit vector j points north) the vector in Cartesian form u = ai + bj...
1 answers
A patient needs 2.5mg of cetirizine daily. The concentration available is 1mg/mL. How much is needed...
A patient needs 2.5mg of cetirizine daily. The concentration available is 1mg/mL. How much is needed for one dose?...
1 answers
XYZ Candy makes specialty chocolate bars to distribute online, shipping across North America. XYZ has established...
XYZ Candy makes specialty chocolate bars to distribute online, shipping across North America. XYZ has established a great deal of monopoly power in pricing given its specialty status. Let’s assume XYZ’s customers are identical with individual (inverse) demand as P = 2.50 – 0.1Q, wh...
1 answers
Current Attempt in Progress Presented below is information related to equipment owned by Blue Company at...
Current Attempt in Progress Presented below is information related to equipment owned by Blue Company at December 31, 2020. Cost Accumulated depreciation to date Expected future net cash flows Fair value $10,980,000 1,220,000 8,540,000 5,856,000 Blue intends to dispose of the equipment in the coming...
1 answers
The geometric sequence 20, 60, 180, 540,.........., 393 660 has how many terms?
The geometric sequence 20, 60, 180, 540,.........., 393 660 has how many terms?...
1 answers
How do you find the period of #y = 2 tan 3x#?
How do you find the period of #y = 2 tan 3x#?...
3 answers
What is the derivative of #y=(sinx)^x#?
What is the derivative of #y=(sinx)^x#?...
1 answers
Problem 4 (5 pt) Compute a root of the function f(x) = x2-2 using the secant method with initial ...
Problem 4 (5 pt) Compute a root of the function f(x) = x2-2 using the secant method with initial guess xo - 1.5 and xj 1 Choose a different initial guess and compute another root of the function f(x) Problem 4 (5 pt) Compute a root of the function f(x) = x2-2 using the secant method with initial gu...
1 answers
WRITE DOWN THE DIFFERENT CELLS OF THE LYMPHATIC, HEMATIC AND IMMUNE , BASIS OF CLASSIFICATION AND...
WRITE DOWN THE DIFFERENT CELLS OF THE LYMPHATIC, HEMATIC AND IMMUNE , BASIS OF CLASSIFICATION AND THEIR FUNCTIONS List the different cells of the hematic, lymphatic and immune systems. You are welcome to format your paper however you wish. I am most interested in how you are using medical terminolog...
1 answers
Three small metal balls are thrown at different speeds off the top of a building to...
Three small metal balls are thrown at different speeds off the top of a building to hit the ground 25m below. Sphere A is thrown directly downward at 10m/s, while Sphere B is dropped from rest. Sphere C is thrown upwards at 5m/s. Ignore the effects of air resistance. Calculate the time for each sph...
1 answers
4.13. Generalize Exercise 1.2.5 to obtain say that C1,Ca, ,Ck are independent events that have respective...
4.13. Generalize Exercise 1.2.5 to obtain say that C1,Ca, ,Ck are independent events that have respective probabilities Pi,P. Pk Argue that the probability of at least one of C1, C2, , Ck is equal to 1-(1-P)(1-pa)(1-P) -p1) (1- p2):.....
1 answers
What forms do health policies take? Give an example of each.
What forms do health policies take? Give an example of each....
1 answers
Investigators introduce two proteins into the membrane of artificial lipid vesicles: (1) an ATP synthase isolated...
Investigators introduce two proteins into the membrane of artificial lipid vesicles: (1) an ATP synthase isolated from the mitochondria of cow heart muscle, and (2) a light-activated proton pump purified from the prokaryote Halobacterium halobium. The proteins are oriented as shown in the diagram. W...

-- 0.009375--