Question: THIS PROGRAM IS IN C++ iT SHOULD HAVE A MAIN, AND FUNCTION NAME COULD BE ANYTHING 2. Write a program using recursion to generate a

 THIS PROGRAM IS IN C++ iT SHOULD HAVE A MAIN, AND

THIS PROGRAM IS IN C++

iT SHOULD HAVE A MAIN, AND FUNCTION NAME COULD BE ANYTHING

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 XXXXXXX X X X X xx xx xx xx xx xx xx xx X XXXXXX X XXXXXXXXXX Name the program: RecSquaresXX.java or RecSquaresXX.cpp, where XX are your initials

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!