subject

Your job is to write a program that prompts for a number of rows (r) from the user, then prints a parallelogram containing either r or rt1 rows. Your program may only print parallelograms of 3 to 23 rows, so you must force the value of r to be reasonable. After you get r, ifr is even, add one to get an odd number of rows. The upper part of the parallelogram must be right aligned with the point up. The lower part must abut the left margin. To draw the shape, you may only print single character spaces (' '), asterisks or stars (), and newline (\n'), flush or endl. You may not use any output manipulators, e. g., setw (), setfill(), in this program. Per the class design, you may use ONLY 3 LOOPS to print the shape itself, one to count rows, and one for the leading spaces and one for the stars on each row. Also, you MUST calculate the number of spaces and stars on a row from the row number and the total number of rows. You MAY NOT just initialize the values and adjust them up or down by one each row. For example (user entries in bold italic - and separate runs) 1 Enter number of rows: That is too few rows for me to make a parallelogram Enter number of rows: 30 That is too many rows for me to make a parallelogram Enter number of rows: 4 (notice this is changed to 5) Another run: Enter number of rows: 13 As usual, your prompts and error messages may contain any reasonable text. Don't skip a line after your prompt before drawing the parallelogram. Test with entries of too many rows, too few rows, a few even numbers of rows and a few odd numbers of rows. Include 3, 13 and 23 rows in your test set.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
You should try to photograph people on bright sunny days because the light will be best a) true b) false
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
Answers: 1
You know the right answer?
Your job is to write a program that prompts for a number of rows (r) from the user, then prints a pa...
Questions
question
Mathematics, 19.03.2021 18:20
Questions on the website: 13722367