Answered step by step
Verified Expert Solution
Question
1 Approved Answer
// C++ Figures. Create a project titled Lab3 Figures with a single file figures.cpp. Your program should ask the user for a number and then
// C++
Figures. Create a project titled Lab3 Figures with a single file figures.cpp. Your program should ask the user for a number and then print two squares, two diagonal lines and a cross out of stars as shown below. The figure size should be input by the user. Here is an example dialog Input number 4 Note that your program has to work for an arbitrary integer, not just 4. You can use either while or for looping constructs Hints: For cach figure, you nced to use two nested loops: the outer loop will iterate over rows (of stars) and the inner loop will print out the stars in a single row. The programming structure for all figures is similar. Study the code for the odometer program. This program has nested loops which are very similar to what you need to implement column index is red column 0 column 1 column 2 column 3 X 15 row index is green row 0 row l row 2 row 03 13 23 01 02 12 10 20 30 21 31 32 In the second figure (the first diagonal linc), you print a star when the row index is cqual to the column index. In the third figure, you print a star when the column index is the same as the figure size minus the row index. To put another way row plus colum The code for the cross is the combination of the code for the two diagonal lines. equals figure sizeStep 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