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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education