Question
Pattern of Stars Listing 6.4 in the text book demonstrates the use of a nested for loop by printing a pattern of asterisks (stars), starting
Pattern of Stars
Listing 6.4 in the text book demonstrates the use of a nested for loop by printing a pattern of asterisks (stars), starting from the least number of stars per row (1) to the most number of stars per row (10).
Modify this program so that it does the following:
Asks the user how many rows of stars they want.
Prints the stars starting with the most stars per row and ending with the least stars per row (i.e. flipped horizontally).
For maximum extra credit:
Create a void method that generates the pattern.
Sample Output
Enter the number of rows: 7 ******* ****** ***** **** *** ** *
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started