Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here are the answer options QUESTION 1 To mimic a real-world programming situation, you are given partially-completed code, written by a former employee you have

image

image

Here are the answer options

image

QUESTION 1 To mimic a real-world programming situation, you are given partially-completed code, written by a former employee you have just replaced. Your task is to complete the program he was developing Fortunately, the former employee's documentation is up-to-date and quite useful. (He must have been a QUT student!). Below is the incomplete section of the code, taken from the Python program which is to use Turtle to draw a grid. (In this exercise, a grid is a series of rows, and a row is a series of boxes or squares.) To draw a grid, each box (square) is drawn starting and finishing at the top left hand corner of the box, heading east (right). A series of boxes drawn in a horizontal line from left to right form a row. Each subsequent row is drawn underneath the previous row. The number of rows to be drawn is stored in the variable: number_of_rows. The number of boxes to be drawn in each row is stored in the variable: number_of_columns. The existing function goto_next_box_pos () takes care of repositioning the turtle to where the next box in the row is to be drawn. The existing function goto_next_row_pos () takes care of repositioning the turtle to where the next row is to be drawn. Here's the incomplete code. The only missing part is a condition. You can safely assume that all of the other code your predecessor wrote is complete and correct. #draw a series of rows of boxes for each_row in range (number_of_rows): #draw a series of boxes in a horizontal line for each_column in range (number_of_columns): draw_grey_box() draw_white_box() goto_next_box_pos () goto_next_row_pos () else: QUESTION 1 To mimic a real-world programming situation, you are given partially-completed code, written by a former employee you have just replaced. Your task is to complete the program he was developing Fortunately, the former employee's documentation is up-to-date and quite useful. (He must have been a QUT student!). Below is the incomplete section of the code, taken from the Python program which is to use Turtle to draw a grid. (In this exercise, a grid is a series of rows, and a row is a series of boxes or squares.) To draw a grid, each box (square) is drawn starting and finishing at the top left hand corner of the box, heading east (right). A series of boxes drawn in a horizontal line from left to right form a row. Each subsequent row is drawn underneath the previous row. The number of rows to be drawn is stored in the variable: number_of_rows. The number of boxes to be drawn in each row is stored in the variable: number_of_columns. The existing function goto_next_box_pos () takes care of repositioning the turtle to where the next box in the row is to be drawn. The existing function goto_next_row_pos () takes care of repositioning the turtle to where the next row is to be drawn. Here's the incomplete code. The only missing part is a condition. You can safely assume that all of the other code your predecessor wrote is complete and correct. #draw a series of rows of boxes for each_row in range (number_of_rows): #draw a series of boxes in a horizontal line for each_column in range (number_of_columns): draw_grey_box() draw_white_box() goto_next_box_pos () goto_next_row_pos () else: QUESTION 1 To mimic a real-world programming situation, you are given partially-completed code, written by a former employee you have just replaced. Your task is to complete the program he was developing Fortunately, the former employee's documentation is up-to-date and quite useful. (He must have been a QUT student!). Below is the incomplete section of the code, taken from the Python program which is to use Turtle to draw a grid. (In this exercise, a grid is a series of rows, and a row is a series of boxes or squares.) To draw a grid, each box (square) is drawn starting and finishing at the top left hand corner of the box, heading east (right). A series of boxes drawn in a horizontal line from left to right form a row. Each subsequent row is drawn underneath the previous row. The number of rows to be drawn is stored in the variable: number_of_rows. The number of boxes to be drawn in each row is stored in the variable: number_of_columns. The existing function goto_next_box_pos () takes care of repositioning the turtle to where the next box in the row is to be drawn. The existing function goto_next_row_pos () takes care of repositioning the turtle to where the next row is to be drawn. Here's the incomplete code. The only missing part is a condition. You can safely assume that all of the other code your predecessor wrote is complete and correct. #draw a series of rows of boxes for each_row in range (number_of_rows): #draw a series of boxes in a horizontal line for each_column in range (number_of_columns): draw_grey_box() draw_white_box() goto_next_box_pos () goto_next_row_pos () else:

Step by Step Solution

3.41 Rating (148 Votes )

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

Recommended Textbook for

Business Communication Essentials a skill based approach

Authors: Courtland L. Bovee, John V. Thill

6th edition

978-0132971324

More Books

Students also viewed these Programming questions

Question

What are the steps of object-oriented systemsdevelopment?

Answered: 1 week ago

Question

Refer to Exercise 5. Compute a 95% t CI for .

Answered: 1 week ago