Program Input/Output The table below shows sample test cases with input prompts and corresponding output in Turtle canvas that can be used to debug/test your program. It is recommended to test your program thoroughly and not depend only on the provided test cases. Input Prompts Output (Turtle canvas) Enter number of cells in board: 2 Enter the widt

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Topic Video
Question
-1.pdf
Program Input/Output
The table below shows sample test cases with input prompts and corresponding output in Turtle canvas that
can be used to debug/test your program. It is recommended to test your program thoroughly and not depend
only on the provided test cases.
Input Prompts
Output (Turtle canvas)
Enter number of cells in board: 2
Enter the width of each cell: 30
Enter the color (black or red or green or blue): black
Enter number of cells in board: 5
Enter the width of each cell: 15
Enter the color (black or red or green or blue): blue
Enter number of cells in board: 8
Enter the width of each cell: 25
Enter the color (black or red or green or blue): red
Enter number of cells in board: 1
Enter the width of each cell: 5
Enter the color (black or red or green or blue): yettOw
Marning: Invalid number for the cells: 1
Us ind default value of8 cells instead!
Warning: Invalid number tor the celts width:S
Using default vatue of 25 ansteadf
warning Invalid color yettow
USing detault "black" color instead!
Transcribed Image Text:-1.pdf Program Input/Output The table below shows sample test cases with input prompts and corresponding output in Turtle canvas that can be used to debug/test your program. It is recommended to test your program thoroughly and not depend only on the provided test cases. Input Prompts Output (Turtle canvas) Enter number of cells in board: 2 Enter the width of each cell: 30 Enter the color (black or red or green or blue): black Enter number of cells in board: 5 Enter the width of each cell: 15 Enter the color (black or red or green or blue): blue Enter number of cells in board: 8 Enter the width of each cell: 25 Enter the color (black or red or green or blue): red Enter number of cells in board: 1 Enter the width of each cell: 5 Enter the color (black or red or green or blue): yettOw Marning: Invalid number for the cells: 1 Us ind default value of8 cells instead! Warning: Invalid number tor the celts width:S Using default vatue of 25 ansteadf warning Invalid color yettow USing detault "black" color instead!
Preface
The purpose of this assignment is to leam how to use nested loops and Turtle graphics library to draw
complex patterns in Python programming language.
Problem Definition
Your task is to write python program that draws a board with alternating dark cells (black or some other color)
and white cells. The number of cells to use in each row or column, width of each cell, and color to use for dark
cells (either black, red, green, or blue) should be collected from the keyboard after showing appropriate input
prompt messages. Note the following requirements:
The program can either start with a dark (colored) cell or white cell. In the figure below, the
board starts with dark cell.
The program should draw an N by N board where N is the number of cells in a row (or a column).
Note that the shape of board and the cells are both square.
The program should draw a border (black line) around the board as shown in the figure.
The program must prompt for input from the keyboard and then validate the input as follows:
o Number of cells in each row or column must be positive number > 1
Width of each cell must be a positive number > 9
o The color can be one of 4 colors only: black, red, green or blue.
If any of the provided input is invalid then the program should show a warning message and use
the default value for that variable as follows: 8 for the number of cells, 25 for the cell width and
black for the color of the dark cells.
Activate Window
Go to Settings to activa
Transcribed Image Text:Preface The purpose of this assignment is to leam how to use nested loops and Turtle graphics library to draw complex patterns in Python programming language. Problem Definition Your task is to write python program that draws a board with alternating dark cells (black or some other color) and white cells. The number of cells to use in each row or column, width of each cell, and color to use for dark cells (either black, red, green, or blue) should be collected from the keyboard after showing appropriate input prompt messages. Note the following requirements: The program can either start with a dark (colored) cell or white cell. In the figure below, the board starts with dark cell. The program should draw an N by N board where N is the number of cells in a row (or a column). Note that the shape of board and the cells are both square. The program should draw a border (black line) around the board as shown in the figure. The program must prompt for input from the keyboard and then validate the input as follows: o Number of cells in each row or column must be positive number > 1 Width of each cell must be a positive number > 9 o The color can be one of 4 colors only: black, red, green or blue. If any of the provided input is invalid then the program should show a warning message and use the default value for that variable as follows: 8 for the number of cells, 25 for the cell width and black for the color of the dark cells. Activate Window Go to Settings to activa
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,