CSCI 161 — Lab 2
Due: Tuesday, September 12, 2017 @ 10:00AM
Objectives
- Write a Java Project from scratch
- Decompose a problem into a set of smaller problems
- Use good naming conventions when creating methods
- Leverage your improved knowledge of the Java programming language to produce the desired output
Overview
- Write a complete program that produces the figures below as output.
- Use static methods to capture structure and eliminate redundancy in your program.
- Name your Java file
Decomposition.java
Style
Use good programming style: write comments, indent consistently, and use white space to make your program readable. Remember, you can press Control+Shift+F
in Eclipse to format your program, provided you have no serious syntax errors (like unbalanced braces, parentheses, or quotes).
Output Specification
Use PRECISELY the format shown below with the EXACT same spacing.
*
*
*
*****
*****
* *
*
* *
* *
*
* *
*****
*****
*
*
*
*****
*****
*****
*****
* *
*
* *
Required Methods
- Create one method for each of the 3 figures.
- Use additional static methods to eliminate redundancy.
- Create a
main()
method which will call other methods to draw each of the three figures
Hints and Reminders
- Create a new project for this lab. If you forget how, review Lab 1
- There are 2 blank lines between figures.
- The only
println()
statements in main()
should produce empty lines
- Eliminate as much redundancy as possible — consider the number of different "subfigures" being drawn
Submission
Submit the Java source code file on Autolab under the "Lab 2" assignment.
Grading
- 20 points will be awarded for having a well-formatted, well-documented source code file. This includes your name, date, description, and comments throughout the program. This also includes other style requirements, such as method naming conventions. NOTE: The autograder will not display these points.
- 10 points will be awarded for having the correct name for the source file
- 25 points will be awarded for matching the desired output
- 15 points will be awarded for proper decomposition of each figure (45 points total)
- NOTE: if your program does not compile/run, the highest score you will earn will be a 20/100