Question: C++ codding , not java, please , thanks Question 2 ( 16 marks ) Write a C++ program that uses nested for-loops to display a
C++ codding , not java, please , thanks

Question 2 ( 16 marks ) Write a C++ program that uses nested for-loops to display a shape of characters (see examples). The program should ask the user to enter an integer n representing the number of rows/columns in a square. The number n should be positive and not less than 5. If the user input for n is invalid, then display an appropriate message and exit the program. The program should display a square of size n filled with different characters. The second row and row before last should be filled with the character (#). All other rows will be filled with the character (*). Examples if n=4 Error, small number if n=5 if n=6 if n=7 * * * * * * * * * ** * * * * * * * # # # # # # # # # # # # * * * * * # # # # # # * * * * * * * * * * * * * # # # # # *** * : * # * * * # # # # # # # * * ** #
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
