- Write a
program that uses for statements to print the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; (this causes the asterisks to print side by side).
[Hint: The last two patterns require that each line begin with an appropriate number of blanks. Extra credit: Combine your code from the four separate problems into a single program that prints all four patterns side by side by making clever use of nested for loops.]
(Drawing Patterns with Nested for Loops) Write a program that uses for statements to
print the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; (this causes the asterisks to print side by side).
[Hint: The last two patterns require that each line begin with an appropriate number of blanks. Extra credit: Combine your code from the four separate problems into a single program that prints all four patterns side by side by making clever use of nested for loops.]
it must be one countinuous program
Trending nowThis is a popular solution!
Step by stepSolved in 6 steps with 3 images
- Example code that will, for example, compute the average weight of babies born to mothers that did not drink alcohol, those that did drink alcohol,1-5 drinks a day, 6-10 drinks a day using loops.Print the name of the group with the largest average birth weight and the name of the group with the lowest average birth weight. Below is the example output Average Birth Weights (grams)-----------------------------Did not drink alcohol – 3267Drank 1-5 drinks – 3054Drank 6-10 drinks – 3002Women who drank 6-10 or more drinks had the babies with the lowest average birth weight.Women who did not drink - had the babies with the highest average birth weight.arrow_forwardI have also included a sample output. Python program comments if you are able to do so. Thanks!!arrow_forwardi dont understand the step in the looparrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY