Make sure that the user enters a number between 1 and 20, otherwise print an error message and prompt for another number. Exit the program if the user enters 0. For example, if the user enters the number 5, the output would be: ** *** **** C++ programming ***** **** *** ** Use 3 nested loops; 1. the outside loop should prompt for the size of the triangle, then print the triangle for that size and loop back for another triangle's size. (If the user enters O, then exit the program). 2. the middle loop should print each row in a triangle, one row per each iteration. 3. the inside loop should print the asterisks in each row, one iteration per asterisk. Test your program with several different sized triangles. Once you're satisfied that it works, run your program to capture the output of your program when using sizes 4, 5, 8, and 0 (the sentinel). Submit program file(s) and print screens or snips showing the output.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Make sure that the user enters a number between 1 and 20, otherwise print an error message
and prompt for another number. Exit the program if the user enters 0.
For example, if the user enters the number 5, the output would be:
**
***
****
C++ programming
*****
****
***
**
*
Use 3 nested loops;
1. the outside loop should prompt for the size of the triangle, then print the triangle for
that size and loop back for another triangle's size. (If the user enters O, then exit the
program).
2. the middle loop should print each row in a triangle, one row per each iteration.
3. the inside loop should print the asterisks in each row, one iteration per asterisk.
Test your program with several different sized triangles. Once you're satisfied that it works,
run your program to capture the output of your program when using sizes 4, 5, 8, and 0 (the
sentinel). Submit program file(s) and print screens or snips showing the output.
Transcribed Image Text:Make sure that the user enters a number between 1 and 20, otherwise print an error message and prompt for another number. Exit the program if the user enters 0. For example, if the user enters the number 5, the output would be: ** *** **** C++ programming ***** **** *** ** * Use 3 nested loops; 1. the outside loop should prompt for the size of the triangle, then print the triangle for that size and loop back for another triangle's size. (If the user enters O, then exit the program). 2. the middle loop should print each row in a triangle, one row per each iteration. 3. the inside loop should print the asterisks in each row, one iteration per asterisk. Test your program with several different sized triangles. Once you're satisfied that it works, run your program to capture the output of your program when using sizes 4, 5, 8, and 0 (the sentinel). Submit program file(s) and print screens or snips showing the output.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education