Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 XXXXXXXXXXStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started