i have to write a program where i input two positive integers (L and H) which are both less than 21. the program then prints out a box of solid asterisks wit L horizontal asterisks and H vertical asterisks.

i dont really know where to start... can someone tell me?

Recommended Answers

All 2 Replies

Create two int variable.
Ask user for input
Check if input is valid
if so the proceed else go back to get user input
start a for loop from i = 0; i < L;
start another loop ( nested loop ) that ranges from j = 0; k < H
print out a symbol, in your case its an "*";
after the second nested loop is done, print a new line character to start
the new process in a different line.

Then you are done.

Create two int variable.
Ask user for input
Check if input is valid
if so the proceed else go back to get user input
start a for loop from i = 0; i < L;
start another loop ( nested loop ) that ranges from j = 0; k < H
print out a symbol, in your case its an "*";
after the second nested loop is done, print a new line character to start
the new process in a different line.

Then you are done.

Just one pedantic point.
The ordering of the loops should probably be:

loop from 0 to < H
    loop from 0 to < L (nested loop)

Cheers,
JD

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.