Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Write a Java program Rocket Problem For this assignment, you are going to generate output that looks like the following: //* /// 1717/** 1../..../.. 1./

Write a Java program

image text in transcribed

image text in transcribed

image text in transcribed

Rocket Problem For this assignment, you are going to generate output that looks like the following: //* /// 1717/** 1../\..../.. 1./ ../11.1 1/1VVVV IWI . \.. \.| 1../..../..1 IVVVVVVI | \/\/ \/\/.| 1..V....V.. 1../..../... 1./ ../11.1 I/WWWWW // /// //// 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 printin statements that use the class constant. You may use 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. You should once again include a comment at the beginning of your class files with basic information and a description of what the program does. You should also include a comment on each individual method describing what it does. You will have two classes, one that has a main method and another class that has a draw Rocket method along with all of your supporting static methods. The class constant for the size of the rocket should go in your helper class. Name these classes Draw Rocket.java and RocketHelper.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 5. the output should look like this: // \ ////** //////// 1.... ........ ....1 1 .../V\....../ ... 1../ ..../V .. 1. /\/\/\/ ../ V . /\/\/\/\/\/\/\/\/\/\/ WWWWWWWWVVI . \ .. .| T..\/\/\....\\ ..| ..\/\/....../ ...| ...V. ... ....! - - - - + I\ \ \ \ \ \ \ \ \ \ \/\ /WWW. 1..\ \ \ ...\ \ \ .. 1...\/\ ...V .... ../\/\/ ..../ .. 1./VVV../WWW. I/WWWWWWWWWW / 11/11 Requirements You must have a helper class RocketHelper with a drawRocket method, a class constant for the size of the rocket and all supporting methods required to draw the rocket itself. The drawRocket method should only have method calls, no loops or print statements and you must eliminate redundant code wherever possible. Your other class, DrawRocket, will have a main method that calls the draw Rocket method in your helper class but that is all. Review the grading rubric on Canvas for additional information on how your submission will be scored

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students explore these related Databases questions