** ** Enter the number of rows 20 Enter the number of asterisks in the first row 1 Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1 ** ***

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter3: Understanding Structure
Section: Chapter Questions
Problem 4PE
icon
Related questions
Question

IN C++ PROGRAMMING LANGUAGE!!!

Problem 1 (Star patterns): Write a program Using loops to display the following patterns –

(i)

**********

(ii)

********************

(iii)

*

**

***

****

*****

******

*******

********

*********

**********

(iv)

*

**

***

****

*****

******

*******

********

*********

**********

***********

************

*************

**************

***************

****************

*****************

******************

*******************

********************

(v)

**********

*********

********

*******

******

*****

****

***

**

*

(vi)

********************

*******************

******************

*****************

****************

***************

**************

*************

************

***********

**********

*********

********

*******

******

*****

****

***

**

*

Your program should use loops to display all 6 patterns with one execution.

Input from the keyboard: the number of rows, the number of asterisks in the first row, 1 to increment asterisks in each following row, or   -1 to decrement the number in the following rows, or 0 to keep the same number as in the first row.

Sample screen dialog and output
HOMEWORK 5 Part 1
Enter the number of rows 1
Enter the number of asterisks in the first row 10
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0
**********
Enter the number of rows 1
Enter the number of asterisks in the first row 20
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0
关
Enter the number of rows 10
Enter the number of asterisks in the first row 1
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1
*
**
***
****
*****
******
*******
********
*********
**********
Enter the number of rows 20
Enter the number of asterisks in the first row 1
Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1
*
**
***
****
*****
******
*******
********
关*
**********
***********
关
*************
**************
***************
****************
关*
关**
*******************
关
Transcribed Image Text:Sample screen dialog and output HOMEWORK 5 Part 1 Enter the number of rows 1 Enter the number of asterisks in the first row 10 Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0 ********** Enter the number of rows 1 Enter the number of asterisks in the first row 20 Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 0 关 Enter the number of rows 10 Enter the number of asterisks in the first row 1 Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1 * ** *** **** ***** ****** ******* ******** ********* ********** Enter the number of rows 20 Enter the number of asterisks in the first row 1 Enter 1 if you want *'s to increase on each row, -1 for decrease, 0 for no increase 1 * ** *** **** ***** ****** ******* ******** 关* ********** *********** 关 ************* ************** *************** **************** 关* 关** ******************* 关
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr