Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program has to be coded in C++, you can also do the 3 problems easily by using the following source code. int r, //

image text in transcribed

This program has to be coded in C++, you can also do the 3 problems easily by using the following source code.

int r, // row (or line) counter

c; // column counter

// design 1

// for (r=1... takes care of displaying 3 rows

for (r=1; r

{

// one iteration of the body of this loop displays row number r.

// In other words, " when r is 1, row 1 is displayed; // when r is 2, row 2 is displayed; ..."

// for (c=1... takes care of displaying the 5 columns in row

// number r

for (c=1; c

cout

cout

}

Problem 5 (10 points) Modify (save into a different file) your source code file so that it displays on the screen a design similar to design 4, except that the design is filled with stars instead of numbers. For example, if the user wants the number of rows to be 3 and the number of columns to be 7, the program will display the following design Problem 6 (10 points Modify (save into the same file as problem 5) your source code file so that it displays on the screena design similar to design 5, except that the design is filled with symbol selected by the user instead of always a star. For example, if the user wants the number of rows to be 3, the number of columns to be 7, and the selected symbol to be '@', the program will display the following design Problem 7 (10 points) Modify (save into a different file) your source code file so that it displays on the screen a design similar to design 6, except that the design is a "right triangle" instead of a "rectangle", with the "base" equal to the "height". For example, if the user wants the size of the design to be 5 and the selected symbol to be @', the program will display the following design Validate the value of size read from the user to be between 1 and 20, inclusive

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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

Students also viewed these Databases questions