Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1: Use input and int functions to get a maximum count value, from the user that is running the program. You can pick the

Part 1:
Use input and int functions to get a maximum count value, from the user that is running the program.
You can pick the variable name.
Create a second variable to hold an iteration count value. The iteration count variable will be incremented on each iteration through the loop. You can also select the name of this variable.
Assign the iteration count variable a starting value of 0.
Write a while statement that contains a condition (i.e. innerCount < maxCount) that will have the program continue iterating in the while loop as long as iteration count is less than the maximum count.
Make sure you increment the iteration count variable inside the while loop, or you may end up with an endless loop.
.Inside the loop add a statement to print one asterisk and not break to the next line ( end='' )
.Run the program. You should see a single line of 10 asterisks. From here on down, the loop in Part 1 will be referenced as the Inner-Loop.
Part 2:
Build a second while loop to execute the loop (Inner-Loop) that you completed in Part 1. This new loop
is the Outer-Loop. You can use the same variable you created above for the maximum count variable.
You will need another loop iteration count variable. Set the new loop iteration variable to 0.
Inside the Outer-Loop add the statement:
print()
This will cause a break (movement to the next line) each time through the Outer-Loop. Make sure you increment the new iteration count variable (the one created in step 9) inside the Outer- Loop while loop, or you may end up with an endless loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions