Computers and Technology
Computers and Technology, 13.07.2021 18:20, 21ltilley

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, hope564
Dave has to create animations for a game. which tool can dave use?
Answers: 3
image
Computers and Technology, 22.06.2019 14:30, SKYBLUE1015
What percentage of companies is projected to use social media to locate new employees in 2012
Answers: 2
image
Computers and Technology, 23.06.2019 07:00, MissSmartyPants88
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
image
Computers and Technology, 23.06.2019 19:50, Aprillove7939
Which feature is selected to practice and save the timing of a presentation
Answers: 1
Do you know the correct answer?
Your job is to write a program that prompts for a number of rows (r) from the user, then prints a pa...

Questions in other subjects:

Konu
Mathematics, 20.01.2021 05:50
Konu
Mathematics, 20.01.2021 05:50
Konu
Mathematics, 20.01.2021 05:50