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 (cither 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 o 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. t c ..

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
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
o 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.
e of celia
Transcribed Image Text: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 o 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. e of celia
80%
2 / 4
pa3-1.pdf
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): yellow
Warning: Invalid number for the cells: 1
Using default value of 8 cells instead!
Warning: Invalid number for the cells width: 5
Using default value of 25 instead!
Warning: Invalid color: yellow
Using default "black" color instead!
Transcribed Image Text:80% 2 / 4 pa3-1.pdf 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): yellow Warning: Invalid number for the cells: 1 Using default value of 8 cells instead! Warning: Invalid number for the cells width: 5 Using default value of 25 instead! Warning: Invalid color: yellow Using default "black" color instead!
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY