Question: C++ Exercise: V Shape In this lab, you draw shapes. In particular, the V shape of varying sizes. Using a magnifying glass, you can see

C++ Exercise: V Shape

In this lab, you draw shapes. In particular, the V shape of varying sizes. Using a magnifying glass, you can see that everything drawn on the computer screen is made from many small dots or pixels. Code was written to draw those pixels. You will write code to simulate the pixels needed to draw a V shape. For a pixel (picture element) use a single *, star, or asterisk. You can develop your solution in steps:

1) Write code that displays a 7-line V shape on the screen. This can be done using a double-nested for-loop. The inner loop displays a line of star spaces star, one column (space ' ' or star *) at a time. The outer loop displays multiple lines, one row at a time. A 7-line V pattern can easily be done with 7 cout statements, but that is very limited and you cannot use this approach in the next step. Example: C++ Exercise: V Shape In this lab, you draw shapes. In particular,

2) Instead of only making one V with exactly 7 lines, ask the user how many lines to make the V, then make the V-shape with the size desired. If the size requested is

3) It is tedious to use and test a program if it does one thing and stops. In this step, put the V-shape drawing code inside another loop. It is now triple-nested. The outer loop should repeatedly prompt the user for the number of lines to make the V. If the number is

How many rows tall to draw a 'V'? (0 to quit): 2 the V shape of varying sizes. Using a magnifying glass, you can

How many rows tall to draw a 'V'? (0 to quit): 3 see that everything drawn on the computer screen is made from many How many rows tall to draw a 'V'? (0 to quit): 4 small dots or pixels. Code was written to draw those pixels. You How many rows tall to draw a 'V'? (0 to quit): 0 Goodbye

* + + 7 +

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!