The first parameter “idx” equals to 0 only for the first time this function is called.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →you just need to fish the “drawLab(idx=0, row_cap=4, total=20)” function, which using recursion to draw all the desks and computers in the lab. Here you can adjust the parameters of “row_cap” and “total” to generate different number of desks. The first parameter “idx” equals to 0 only for the first time this function is called. Then idx should increase by 1 every time when it is called.
Rubrics:
(1) Free of grammar errors (15%)
(2) Free of infinite recursion (15%)
(3) Accurately update the parameters for recursion call (10%)
(4) Accurately compute the “pos” member for the desk and computers (20%)
(5) Successfully draw all the computers and desks in the lab (20%)
(6) Provide a report document “.docx” or “.pdf” file to describe what you have accomplished and include two or more snapshots of the rendered lab pictures.
x2 = top_bound + (1/2) * desk.depth
y1 = left_bound + (1/5) * desk.length
y2 = left_bound + (1/2) * desk.length
y3 = left_bound + 1.2 * desk.length
y4 = left_bound + 1.6 * desk.length
rand_x = random.uniform(x1, x2) # for computer 1
rand_y_1 = random.uniform(y1, y2) # for computer 1
computer1 = computer_module.ComputerSet(pos= [rand_x, rand_y_1, desk.pos[2] + 5])
computer1.draw()
rand_x = random.uniform(x1, x2) # for computer 2
rand_y_2 = random.uniform(y3, y4) # for computer 2
computer2 = computer_module.ComputerSet(pos= [rand_x, rand_y_2, desk.pos[2] + 5])
computer2.draw()
# step3: draw the desk
desk.draw()
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds