Question: THIS HAS TO BE IN C++ PLEASE 2. Write a program using recursion to generate a set of squares within a square. Input an integer

THIS HAS TO BE IN C++ PLEASE
2. Write a program using recursion to generate a set of squares within a square. Input an integer n from sizes 5 to 20. Error check. For each input size, you will print a square with n uppercase X's on each side. Then inside that square will be another square, one cell away on each side. This pattern will continue until there is a single square in the middle, thus making a box of concentric squares. The program must use a recursive function/method to draw the squares for full credit. Do not use helper functions/methods. Refer to the sample output below. Sample Runs (2): Enter square size: 5 XXXXX X X xxx x x XXXXX Enter square size: 10 XXXXXXXXXX COSC 2436 S20 x x X XXXXXX X xx xx xx xx xx xx xx xx xx xx X XXXXXX X E XXXXXXXXXX 2. Write a program using recursion to generate a set of squares within a square. Input an integer n from sizes 5 to 20. Error check. For each input size, you will print a square with n uppercase X's on each side. Then inside that square will be another square, one cell away on each side. This pattern will continue until there is a single square in the middle, thus making a box of concentric squares. The program must use a recursive function/method to draw the squares for full credit. Do not use helper functions/methods. Refer to the sample output below. Sample Runs (2): Enter square size: 5 XXXXX X X xxx x x XXXXX Enter square size: 10 XXXXXXXXXX COSC 2436 S20 x x X XXXXXX X xx xx xx xx xx xx xx xx xx xx X XXXXXX X E XXXXXXXXXX
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
