代写 Java CSE 142: Computer Programming I Winter 2020 Assignment 2: Space Needle (16 points) due January 21, 2020, 11:59pm

CSE 142: Computer Programming I Winter 2020 Assignment 2: Space Needle (16 points) due January 21, 2020, 11:59pm
This assignment focuses on for loops, expressions, print and println statements, and constants. Turn in the following TWO Java files using the link on the course website:
• AsciiArt.java – A program that produces your custom ASCII Art
• SpaceNeedle.java – A program that produces the ASCII Art Space Needle described below
Program Behavior
Part A: ASCII Art (2 points)
The first part of your assignment is to write a program that produces any text art (sometimes called “ASCII art”) picture you like. Your program can produce any picture you like, with the following restrictions:
• The picture should be your own creation, not an ASCII image you found on the Internet or elsewhere.
• The picture should not include hateful, offensive, or otherwise inappropriate images.
• The picture should consist of between 3 and 200 lines of output, with no more than 100 characters per line.
• The picture must not be substantially similar to your solution for Part B, consist entirely of reused Part B code, or be substantially similar to a related CSE142 assignments from a previous quarter.
• The code must use at least one for loop or static method but should not contain infinite loops.
• The code must not use material beyond Ch. 3 of the textbook.
If your program compiles, runs, and meets all of the above requirements, you will receive the full 2 points.
Part B: Space Needle (14 points)
The second part of your assignment is to produce a specific text figure that is supposed to look like Seattle’s Space Needle. Your program should exactly reproduce the format of the output on the next page, including characters and spacing. The Output Comparison Tool will be helpful in confirming you’ve produced the correct output.
In addition to producing the default Space Needle shown below, your program will need to be able to be easily modified to produce similar images of different sizes. You will still only turn in one program, and your program will only produce one size of output on any given run. However, we should be able to make a single change to your code and recompile to produce a different size. See below for more details.
Development Strategy
Since this is a more complex program, we suggest you approach the program in stages rather than trying to implement everything at once. We specifically recommend following these steps:
(1) Tables: Utilize loop tables as demonstrated in class to find the patterns and expressions for repeated sequences of characters.
(2) Default size: Implement the code necessary to produce the Space Needle using the default size of 4. DO NOT think about other sizes yet.
(3) Scaling: Once your default size completely works, add your constant (see below) and modify your code so the output can be scaled to different sizes.
􏰆
As on assign- ment 1, you must exactly match the out- put.
􏰆
You should be able to change a single value at one point
in the code to scale the figure.
Page 1 of 3

Expected Output (size 4)
||
||
||
||
__/||\__
__/:::||:::\__
__/::::::||::::::\__
__/:::::::::||:::::::::\__
|””””””””””””””””””””””””|
\_/\/\/\/\/\/\/\/\/\/\/\_/
\_/\/\/\/\/\/\/\/\/\_/
\_/\/\/\/\/\/\/\_/
\_/\/\/\/\/\_/
||
||
||
||
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
|%%||%%|
__/||\__
__/:::||:::\__
__/::::::||::::::\__
__/:::::::::||:::::::::\__
|””””””””””””””””””””””””|
Permitted Java Features
Implementation Guidelines
Like all CSE 142 assignments, Part B of this assignment will be graded both on “external correctness” (whether the program com- piles and produces exactly the expected output) and “internal cor- rectness” (whether your source code follows the implementation and style guidelines in this document). You will need to adhere to the following guidelines to receive full credit on part B. (Part A of this assignment is graded only on the requirements stated above; it is not graded on internal correctness.)
Using for loops
One way to write a Java program to draw this figure would be to write a System.out.println statement that prints each line of the figure. However, this solution would be redundant and inflexible. Instead, you are required to use for loops to create a more generalized version of the program. Specifically, in lines that have repeated patterns of characters that vary in number from line to line, your code should print the lines and character patterns using nested for loops. You may find it helpful to write pseudocode and tables to understand the patterns, as described in the textbook and lecture.
Scaling with a class constant
As described above, your program should be able to be easily changed to produce a figure of a different size. To achieve this, your program should include one (and only one) class constant that represents the size of the figure. (The default size of the figure is 4.) Throughout your program, any values that are related to the size of the figure should refer to this constant so that a different size of figure can be produced by changing only the value of the constant. Your program should work correctly for any size greater than or equal to 2. See the course website for examples of different sizes of Space Needles.
The course web site will contain files that show you the expected output if your size constant is changed to various other values. You can use the Output Comparison Tool on the course web site to measure numbers of characters and to verify the correctness of your output for various values of the size constant.
􏰆
The height
of the Space Needle’s body grows with the square of the figure’s size. For example, in our size 4 default, the body is 16
(4 x 4) lines tall.
For this assignment, you are restricted to Java concepts covered in chapters 1 and 2 of the textbook. In particular, you MUST use for loops and class constants (see below) and you may not use parameters. You also still may not use the \n escape sequence.
Page 2 of 3

Style Guidelines
You should follow all guidelines in the Style Guide and on the General Style Deductions page of the course website. Pay particular attention to the following elements:
Capturing Structure
As in assignment 1, you should use static methods to accurately capture the structure of the output in your program. In particular, your main method should be a concise summary of the program and reflect the structure of the figure being produced. Your program should not include any System.out.println statements in main.
Reducing Redundancy
You should continue to reduce redundancy as much as possible in your program by making good use of static methods. Specifically, you should not have any redundant code to produce the same full line of output. Instead, use methods to remove this redundancy. Similar to assignment 1, this only applies to full-line redundancy. You are not expected to deal with partial-line redundancy, such as the two groups of colons in this line of output:
__/::::::||::::::\__
Code Aesthetics
Your code should be properly indented, make good use of blank lines and other whitespace, and in- clude no lines longer than 100 characters. Your class, methods, variables, and constant should all have meaningful and descriptive names and follow the standard Java naming conventions. (e.g. ClassName, methodOrVariableName, CONSTANT_NAME) See the Style Guide for more information.
Commenting
Your code should include a header comment at the start of your program, following the same format described in assignment 1. Your code should also include a comment at the beginning of each method that describes that methods behavior. Comments should be written in your own words (i.e. not copied and pasted from this spec) and should not include implementation details (such as describing loops or expressions included in the code). See the Style Guide or lecture code for examples.
Getting Help
If you find you are struggling with this assignment, make use of all the course resources that are available to you, such as:
• Reviewing relevant lecture examples
• Reviewing this week’s section handouts • Reading the textbook
• Visiting the IPL
• Posting a question on the message board
Academic Integrity
Remember that, while you are encouraged to use all resources at your disposal, including your classmates, all work you submit must be entirely your own. In particular, you should NEVER look at a solution to this assignment from another source (a classmate, a former student, an online repository, etc.). Please review the full policy in the syllabus for more details, and ask the course staff if you are unclear on whether or not a resource is OK to use.
􏰆
Try to iden- tify the large chunks of the output and write a method for each, as in the tapestry example from lecture.
􏰆
This will result in some redun- dant code. This is OK, but only if that code
is producing partial-line re- dundancy as described here. All other re- dundant code should be fixed.
Page 3 of 3