Answered step by step
Verified Expert Solution
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 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
Please answer all parts of 2 and 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started