Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer all parts of 2 and 3 2. (2.5 pts) In our flu virus simulation discussed in class, suppose that our canvas is 600

Please answer all parts of 2 and 3 image text in transcribed
2. (2.5 pts) In our flu virus simulation discussed in class, suppose that our canvas is 600 pixels wide and 400 pixels high, but we still want to display the same 400 people as rectangles in 20 rows with 20 columns. (a) What is the size of each rectangle in pixels? pixels wide by pixels high (b) Write the drawing command in the simulation so that it draws each rectangle in its correct place on the canvas. Remember that this code is in a set of nested loops with loop variables row and col respectively and a variable color that is set to the desired color for that rectangle given the person's health state in the matrix at the given row and col c.create rectangle( fill = color, outline = "black") 3. (1 pt) In the simulation for the spread of the flu virus demonstrated in class, there were some subtle issues that we overlooked. Review the code and answer the following statements. TRUE OR FALSE: When a person contacts four people, they are not guaranteed to be different people. a. b. TRUE OR FALSE: When a person contacts four random people, at most one of them can be contagious TRUE OR FALSE: When a person contacts four random people to see if any are contagious, the person could contact himself/herself. C. d. TRUE OR FALSE: A person can get infected by contacting himself/herself

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the role of business ethics?

Answered: 1 week ago

Question

2. Outline the business case for a diverse workforce.

Answered: 1 week ago