how would you write this program using parameters and loops ? How wide do you wa
ID: 3547311 • Letter: H
Question
how would you write this program using parameters and loops ?
How wide do you want your floor to be? 9
How long do you want your floor to be? 5
-------------------------------------
| | | | | | | | | |
| | | | | | | | | |
-------------------------------------
| | | | | | | | | |
| | | | | | | | | |
-------------------------------------
| | | | | | | | | |
| | | | | | | | | |
-------------------------------------
| | | | | | | | | |
| | | | | | | | | |
-------------------------------------
| | | | | | | | | |
| | | | | | | | | |
-------------------------------------
Explanation / Answer
Step 1 : take the input , and store them in variable say width and height
Step 2 : run two loops
for(i =0 ; i < height ; i++)
for(j = 0 ; j <width ; j++)
Step 3 : write the code corresponding each segment
Step 4: Print the answer
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.