Write a program that displays a window into a “network” of boxes connected by lines. See examples below. Query the user for the width and height of the display window (in characters) and also the size of the boxes (they are squares of with identical height and width, in characters) and the length of an edge (lines between boxes, in characters). Draw the network of boxes starting from the upper left, starting always with a square. Connect squares horizontally and vertically with an edge in the middle of the box. Any inputs that are not positive integers should be queried again until the user provides a positive integer.

If the square size is even, edges should be double width. If the square size is odd, use only single “-” characters. Square corners should be rendered with a “#” character. The pipe character (“|”) can be found on your keyboard above the backslash character.

Your program should work with any positive value for the size of the squares, the length of the edges, and the height and width of the display window.

The input on the screen might look like this (two lines when square size is even):

Input your desired height: derp!
Error: please type in an integer.
Input your desired height: 21
Input your desired width: 39
Input square size: 8
Input edge length: 4
#------# #------# #------# #--
| | | | | | |
| | | | | | |
| |----| |----| |----|
| |----| |----| |----|
| | | | | | |
| | | | | | |
#------# #------# #------# #--
|| || ||
|| || ||
|| || ||
|| || ||
#------# #------# #------# #--
| | | | | | |
| | | | | | |
| |----| |----| |----|
| |----| |----| |----|
| | | | | | |
| | | | | | |
#------# #------# #------# #--
|| || ||

Or look like this (Here the square (size 1) is just a single “#”. The connection between the squares is the - character. Odd-sized squares just have one line, not two):

Input your desired height: 11
Input your desired width: 26
Input square size: 1
Input edge length: 3
#---#---#---#---#---#---#-
| | | | | | |
| | | | | | |
| | | | | | |
#---#---#---#---#---#---#-
| | | | | | |
| | | | | | |
| | | | | | |
#---#---#---#---#---#---#-
| | | | | | |
| | | | | | |

Or look like this (the window is smaller than a single square):

Input your desired height: 8
Input your desired width: 14
Input square size: 26
Input edge length: 25
#-------------
|
|
|
|
|
|
|

To solve this task, you can use the following steps:

1. Prompt the user for the height and width of the display window and validate the inputs to ensure they are positive integers. Repeat the prompt until valid inputs are provided.
2. Prompt the user for the size of the squares (square height and width) and validate it to ensure it is a positive integer. Repeat the prompt until a valid input is provided.
3. Prompt the user for the length of the edges and validate it to ensure it is a positive integer. Repeat the prompt until a valid input is provided.
4. Based on the size of the squares, determine if the edges should be single or double in width.
5. Initialize an empty string variable for the first row and second row of a single square.
6. Fill the first row and second row of a single square with the appropriate characters considering the square size and edge length (using single or double width edges and the '#' and '|' characters for corners).
7. Initialize an empty string variable for the complete network of squares.
8. Iterate over the rows and columns of the display window.
9. For each row and column, use a nested loop to iterate over the characters of a single square.
10. Append the characters of a square to the complete network string, repeating based on the size of the squares.
11. Determine the appropriate horizontal connection ('-' character) based on the position and size of the squares.
12. Append the horizontal connections to the complete network string.
13. Determine the appropriate vertical connection ('|' character) based on the position and size of the squares.
14. Append the vertical connections to the complete network string.
15. Print the complete network string to display the network of boxes connected by lines in the desired window size.

By following these steps, you should be able to create a program that displays the network of boxes as described in the task.