Question: Problem: Write a program to generate the output provided in the output.txt file using for loops. For week 3 you only need to display the
Problem: Write a program to generate the output provided in the output.txt file using for loops. For week 3 you only need to display the image at size 3. For week 4 you must be able to change a class constant to resize the image to any size. Requirements: 1. You must break down the problems into smaller problems by creating methods. 2. You must use a class constant for the size of the figure so that we can generate the figure with different sizes. (week 4) 3. You are required to have the following methods: a. main: must have only one line of code, which is a method call. b. top: draws the top part of the figure (refer to the sample output) c. bottom: draws the bottom part of the figure(refer to the output) d. line: draws the specified line(refer to the output) e. draw: calls the other methods to draw the figure on the screen 4. You are required to provide comments throughout your code and a header comment. 5. You must have proper indentation. 6. You must have proper naming. 7. Your program must generate the exact same output that is provided to you. 8. Create tables in order to find out the loop control values. Size 3 +------+ <-- line | ^^ | | ^ ^ | |^ ^| | ^^ | <-- top | ^ ^ | |^ ^| +------+ <-- line |v v| | v v | | vv | <-- bottom |v v| | v v | | vv | +------+ <-- line ______________________________________________ Size 6 +------------+ | ^^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | |^ ^| | ^^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | |^ ^| +------------+ |v v| | v v | | v v | | v v | | v v | | vv | |v v| | v v | | v v | | v v | | v v | | vv | +------------+ _________________________________________ Size 9 +------------------+ | ^^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | |^ ^| | ^^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | | ^ ^ | |^ ^| +------------------+ |v v| | v v | | v v | | v v | | v v | | v v | | v v | | v v | | vv | |v v| | v v | | v v | | v v | | v v | | v v | | v v | | v v | | vv | +------------------+
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
