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

2. (2.5 pts) In our flu virus simulation discussed in class, suppose that our ca

ID: 3701630 • Letter: 2

Question

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

Explanation / Answer

Q. 2: a) 30 pixels wide by 20 pixels high

b) c.create_rectangle( col*30, row*20, col*30+30, row*20+20, fill = color, outline = "black")

Q.3 a. FALSE

b. FALSE

c. FALSE

d. FALSE

(Note: demonstartion presented in the class is given here)

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