Question: Write a complete program that: 1 . Uses a do . . . while loop to prompt the user to enter a count that is
Write a complete program that: Uses a dowhile loop to prompt the user to enter a count that is greater than and less than or equal to then readsin a count from the keyboard as an integer.a If input error occurs or the count the user enters is less than or equal to or greater than output an error.After outputting an error, clearignore the failed input and continue dowhile looping until a valid number isentered Writes a triangle to the display using for loops. The triangle will be upside down. To write this triangle to the display:a amountOfStars number entered in b Output amountOfStars followed by a new line.c Decrement amountOfStars by one.d Continue from b until amountOfStars is zero Writes a triangle to the display using while loops. The triangle will be rightside up To write this triangle to the display:a amountOfStars b Output amountOfStars followed by a new line.c Increment amountOfStars by one.d Continue from b until amountOfStars is greater than the number entered in
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
