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 8 (10 points) Modify (save into a different file) your source code file so that it displays on the screen a design similar to design 7, except that the design is a "slightly different triangle." 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 Hint The design consists of the number of rows specified by 'size Row 1 consists of 4 leading blanks, followed by 1 selected symbol Row 2 consists of 3 leading blanks, followed by 2 selected symbols. Row 3 consists of 2 leading blanks, followed by 3 selected symbols. Row 4. Can you detect the "pattern" in each row? Problem 9 (10 points) Modify (save into a different file) your source code file so that it displays on the screen a design similar to design 8, except that the design is a bit more complex. 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 Hint: To display this design, first display its top half, and then its bottom half. Validate the value of size read from the user to be between 1 and 10, 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

Rules In Database Systems Third International Workshop Rids 97 Sk Vde Sweden June 26 28 1997 Proceedings Lncs 1312

Authors: Andreas Geppert ,Mikael Berndtsson

1997th Edition

3540635165, 978-3540635161

Students also viewed these Databases questions

Question

define what is meant by the term human resource management

Answered: 1 week ago