Question: // 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++

// C++ Figures. Create a project titled Lab3 Figures with a singlefile figures.cpp. Your program should ask the user for a number and

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 size

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!