COSC 1336 Programming Assignment #2 solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)
This assignment will give you practice with for loops, static methods, print/println statements and a
class constant. This assignment is worth 100 points. You are going to generate output that looks
like the following:
/**\
//**\\
///**\\\
////**\\\\
/////**\\\\\
+=*=*=*=*=*=*+
|../\…./\..|
|./\/\../\/\.|
|/\/\/\/\/\/\|
|\/\/\/\/\/\/|
|.\/\/..\/\/.|
|..\/….\/..|
+=*=*=*=*=*=*+
|\/\/\/\/\/\/|
|.\/\/..\/\/.|
|..\/….\/..|
|../\…./\..|
|./\/\../\/\.|
|/\/\/\/\/\/\|
+=*=*=*=*=*=*+
/**\
//**\\
///**\\\
////**\\\\
/////**\\\\\
You are to exactly reproduce this output. The various subfigures in the middle of this output have
a height of 3. These subfigures have the property that their height determines their width, so there
is only one size variable. You are to use a class constant to make it possible to change a single
number in one place in the program to have it produce a corresponding figure of a different size.
This assignment is meant to give you practice with the constructs from chapters 1 and 2. This will
require you to create nested for loops with print and println statements that use the class
constant. If you are interested, you may use the constructs from chapter 3, although you are not
required to do so and you will receive no extra credit for doing so. You may not use any
programming constructs that are not in chapters 1 through 3 of the textbook.
You should continue to use static methods to structure your solution. You should try to avoid
significant redundancy and you should structure your program in such a way that the methods
match the structure of the output itself. You are required to properly indent your code and will lose
points if you make indentation mistakes. You should localize variables whenever possible.
Include a comment at the beginning of your program with basic information and a description of
the program and include a comment for each method. Name your file Rocketship.java.
On any given execution your program will produce just one version of this figure, but it should be
possible to change the value of the program constant to have your program produce a figure of a
different size. For example, with subfigures of height 7, the figure should look like this:
/**\
//**\\
///**\\\
////**\\\\
/////**\\\\\
//////**\\\\\\
///////**\\\\\\\
////////**\\\\\\\\
/////////**\\\\\\\\\
//////////**\\\\\\\\\\
///////////**\\\\\\\\\\\
////////////**\\\\\\\\\\\\
/////////////**\\\\\\\\\\\\\
+=*=*=*=*=*=*=*=*=*=*=*=*=*=*+
|……/\…………/\……|
|…../\/\………./\/\…..|
|…./\/\/\……../\/\/\….|
|…/\/\/\/\……/\/\/\/\…|
|../\/\/\/\/\…./\/\/\/\/\..|
|./\/\/\/\/\/\../\/\/\/\/\/\.|
|/\/\/\/\/\/\/\/\/\/\/\/\/\/\|
|\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
|.\/\/\/\/\/\/..\/\/\/\/\/\/.|
|..\/\/\/\/\/….\/\/\/\/\/..|
|…\/\/\/\/……\/\/\/\/…|
|….\/\/\/……..\/\/\/….|
|…..\/\/……….\/\/…..|
|……\/…………\/……|
+=*=*=*=*=*=*=*=*=*=*=*=*=*=*+
|\/\/\/\/\/\/\/\/\/\/\/\/\/\/|
|.\/\/\/\/\/\/..\/\/\/\/\/\/.|
|..\/\/\/\/\/….\/\/\/\/\/..|
|…\/\/\/\/……\/\/\/\/…|
|….\/\/\/……..\/\/\/….|
|…..\/\/……….\/\/…..|
|……\/…………\/……|
|……/\…………/\……|
|…../\/\………./\/\…..|
|…./\/\/\……../\/\/\….|
|…/\/\/\/\……/\/\/\/\…|
|../\/\/\/\/\…./\/\/\/\/\..|
|./\/\/\/\/\/\../\/\/\/\/\/\.|
|/\/\/\/\/\/\/\/\/\/\/\/\/\/\|
+=*=*=*=*=*=*=*=*=*=*=*=*=*=*+
/**\
//**\\
///**\\\
////**\\\\
/////**\\\\\
//////**\\\\\\
///////**\\\\\\\
////////**\\\\\\\\
/////////**\\\\\\\\\
//////////**\\\\\\\\\\
///////////**\\\\\\\\\\\
////////////**\\\\\\\\\\\\
/////////////**\\\\\\\\\\\\\
You should include a comment at the beginning of your program with some basic information and
a description of the program, as in:
// Name: Your Name
// Date: 10/1/2016
// COSC 1336
// Assignment #2
//
// This program will…
You should name your file Rocketship.java.
Submission and Grading:
Turn in your Rocketship.java file electronically from the Homework Assignments link on the
Canvas course web page. Please make sure to use exactly this file name, including identical
capitalization.
Part of your program’s score will come from its “external correctness.” (50 points) External
correctness measures whether the output matches exactly what is expected. (I am very picky about
the output matching exactly. Every character and space must match.) Programs that do not
compile will receive no external correctness points.
The rest of your program’s score will come from its “internal correctness.” (50 points) Internal
correctness measures whether your source code follows the stylistic guidelines specified in this
document.