Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

So I have this C++ project that is supposed to diplay like this: I can't seem to get the bottom one to work. This is

So I have this C++ project that is supposed to diplay like this:

image text in transcribed

I can't seem to get the bottom one to work.

This is what I have so far

#include

#include

using namespace std;

void patternOne(int);

void patternTwo(int);

void patternThree(int);

int main() {

int numberOfRows = 5;

cout

patternOne(numberOfRows);

cout

patternTwo(numberOfRows);

cout

patternThree(numberOfRows);

return 0;

}

//patternOne function prototype

void patternOne(int rows) {

for (int row = 1; row

{

for (int count = 1; count

{

cout

}

cout

}

}

//patternTwo function prototype

void patternTwo(int rows) {

for (int row = rows; row >= 1; row--)

{

for (int count = row; count >= 1; count--)

{

cout

}

cout

}

}

//patternThree function prototype

void patternThree(int rows) {

for (int row = rows; row >= 1; rows--)

{

for (row = 0; row

{

cout

for (int count = row; count >= 1; count--)

{

cout

}

cout

}

}

}

1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 Pattern 3 1 2 3 4 5 1 2 3 4 1 2 3 1 2

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 Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions