Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this program can have varying output results based on the value assigned to a single class constant. This class constant determines the height of the

this program can have varying output results based on the value assigned to a single class constant. This class constant determines the height of the firecracker. The firecracker shown above has a height of 5.
Define 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.
When you submit your code, it doesn't matter what value you set for the constant. I'll change it to see how your code works with different outputs.
On any given execution, your program will produce just one version of this figure.
For example, with a height of 8, the output should look like this:
//\\
//!!\\
//!!!!\\
//!!!!!!\\
//!!!!!!!!\\
//!!!!!!!!!!\\
//!!!!!!!!!!!!\\
+~~~~~~~~~~~~~~~~+
[\/\/\/\/\/\/\/\/]
[-\/\/\/\/\/\/\/-]
[--\/\/\/\/\/\/--]
[---\/\/\/\/\/---]
[----\/\/\/\/----]
[-----\/\/\/-----]
[------\/\/------]
[-------\/-------]
[//////----\\\\\\]
[/////------\\\\\]
[////--------\\\\]
[///----------\\\]
[//------------\\]
[/--------------\]
[\/\/\/\/\/\/\/\/]
[-\/\/\/\/\/\/\/-]
[--\/\/\/\/\/\/--]
[---\/\/\/\/\/---]
[----\/\/\/\/----]
[-----\/\/\/-----]
[------\/\/------]
[-------\/-------]
+~~~~~~~~~~~~~~~~+
//\\
//!!\\
//!!!!\\
//!!!!!!\\
//!!!!!!!!\\
//!!!!!!!!!!\\
//!!!!!!!!!!!!\\
And finally, Submit it as FireCracTwo.java file on Canvas.

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

Students also viewed these Databases questions