This website is in open beta, but is still under development. All content, including course policies, requirements, and schedules, is subject to change.
Initial submission due Wednesday, July 6, 11:59pm PT
This assignment will assess your mastery of the following objectives:
The first part of your assessment 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:
This part of the assessment will only contribute to the Behavior dimension grade. It will not factor in to grading on the other dimensions.
The second part of your assessment 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 below, including characters and spacing. The Mark button in Ed 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.
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:
Like all CSE 142 assessments, Part B of this assessment will be graded on all four dimensions defined in the syllabus. Be sure to adhere to the following guidelines:
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.
As described above, your program should be able to be easily changed to produce a figure of a different size. For example, Space Needles of size 2 and 3 are shown below. 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.) To ensure our testing and grading scripts work correctly, you must name your constant SIZE. 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.
SIZE
or you won't be able to pass our tests!
The course website and Ed lesson will contain files that show you the expected output if your size constant is changed to various other values. You can use the Mark button in Ed to verify the correctness of your output for various values of the size constant.
For this assessment, 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 above) and
you may not use parameters. You also still may not use the \n
escape sequence.
In addition to producing the desired behavior, your code should be well-written and meet all expectations described in the grading guidelines and the Code Quality Guide. For this assessment, pay particular attention to the following elements:
As in Take-Home Assessment 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
or System.out.print
statements or any
for
loops in main
.
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 Take-Home Assessment 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:
__/::::::||::::::\__
Your code should be properly indented, make good use of blank lines and other whitespace, and include
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 Code Quality Guide for more information.
Your code should include a header comment at the start of your program, following the same format described in Take-Home Assessment 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 Code Quality Guide for examples and more information.
If you find you are struggling with this assessment, make use of all the course resources that are available to you, such as:
Remember that, while you are encouraged to use all resources at your disposal, including your classmates, all work you submit must be your own. In particular, you should NEVER look at a solution to this assessment 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.
In addition to your code, you must submit answers to short reflection questions. These questions will help you think about what you learned, what you struggled with, and how you can improve next time. The questions are given in the "Reflection.txt" file on the Space Needle slide in the Ed assessment.
Running and Submitting You can run your program by clicking the "Run" button in Ed. This will compile and execute your code and show you any errors, or the output of your program if it runs correctly. If you believe your output is correct, you can submit your work by clicking the "Mark" button in the Ed lesson. You will see the results of some automated tests along with tentative grades. This grade is not final until you have received feedback from your TA.
You may submit your work as often as you like until the deadline; we will always grade your most recent submission. Note the due date and time carefully—work submitted after the due time will not be accepted.