Answered step by step
Verified Expert Solution
Link Copied!

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++

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions

Question

What is the use of bootstrap program?

Answered: 1 week ago

Question

What is a process and process table?

Answered: 1 week ago

Question

What is Industrial Economics and Theory of Firm?

Answered: 1 week ago