Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming language is C++ PA 9-3 (25 points) Output a diamond composed of asterisks. Have the user specify the width with max (21) and min

Programming language is C++

image text in transcribed

PA 9-3 (25 points) Output a diamond composed of asterisks. Have the user specify the width with max (21) and min (3) allowable. Even numbers inputs are not allowed. This is pretty tricky. If you can do this, you have a good knowledge of for loops. If the user makes an illegal entry (out of range or an even number, tell them and allow them to keep trying until they get it right. Hint: Use two nested for loops - one for top half, another for bottom. Inside of each use two for loops - the first for spaces, the second for the *'s. The number of space and *'s depends on what row you are on. Some of the Sample Programs should help D:ACodeBlocks-EP CodeBlocks-EP Marsh2050bin\DebuglMarsh2050.exe at is the width of your diamond? (3 to 21, odd values on ly): 1 width is out of range. Please try again at is the width of your diamond? (3 to 21, odd values on ly): 27 idth is out of range. Please try again hat is the width of your diamond? (3 to 21, odd values only)8 You need to enter an odd value. at is the width of your diamond? (3 to 21, odd values only): 13 PA 9-3 (25 points) Output a diamond composed of asterisks. Have the user specify the width with max (21) and min (3) allowable. Even numbers inputs are not allowed. This is pretty tricky. If you can do this, you have a good knowledge of for loops. If the user makes an illegal entry (out of range or an even number, tell them and allow them to keep trying until they get it right. Hint: Use two nested for loops - one for top half, another for bottom. Inside of each use two for loops - the first for spaces, the second for the *'s. The number of space and *'s depends on what row you are on. Some of the Sample Programs should help D:ACodeBlocks-EP CodeBlocks-EP Marsh2050bin\DebuglMarsh2050.exe at is the width of your diamond? (3 to 21, odd values on ly): 1 width is out of range. Please try again at is the width of your diamond? (3 to 21, odd values on ly): 27 idth is out of range. Please try again hat is the width of your diamond? (3 to 21, odd values only)8 You need to enter an odd value. at is the width of your diamond? (3 to 21, odd values only): 13

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions