CSS 142 University of Washington Loops and Rockets Java Project Hello i have added the file that you need to complete the assignment please review and ask
CSS 142 University of Washington Loops and Rockets Java Project Hello i have added the file that you need to complete the assignment please review and ask any question.
Here is a final checklist of items to run through before you submit your work:
You should be turning-in only one file (your Java source code file).
Compile and execute your code before turning in your .java file. If it doesn’t work, something is wrong.
Check the extension of the file you are submitting. There is only one file type you are allowed to submit.
Do your filenames follow the correct convention as described in the assignment.
Break up this program into smaller functions and call those.
Remember you can call a function inside of a loop.
Pay extra attention to code formatting, style, comments, and basic programming practices learned so far. CSS142: Homework: Loops – Rockets
Homework: Loops — Rockets
CSS 142: Computer Programming I
Summary
Using your knowledge of loops and boolean expression, you will create a program that will exactly
reproduce the output as in the following. 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 only one
size is used. The height also determines the height of the nose of the rocket and the rocket thrust.
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 (note: the code for the class
constant HEIGHT is given in the following example). Design static methods for your solution so that your
program will avoid significant redundancy. For example, the method displayCone() would display the
rocket nose and also the rocket thrust. Structure your program in such a way that the methods match
the structure of the output itself (i.e. method displayCone() displays the rocket’s cone structure.)
Note that the backslash is a control character so to display one backslash, you must use two of them. For
example, System.out.println(“\/”); would display: /
Note: Your program’s methods need to use “for” or “while” loops to complete the given task with
different HEIGHT values.
Sample Code and the display on the next page.
1
CSS142: Homework: Loops – Rockets
public class LastFirstHWLoops {
public static final int HEIGHT = 3;
}
// height of rocket internal subfigures
public static void main(String[] args) {
displayCone();
// display rocket nose
…
displayCone();
// display rocket thrust
}
…
/**
//**\
///**\
////**\\
/////**\\
+=*=*=*=*=*=*+
|../…./..|
|.//..//.|
|//////|
|//////|
|.//..//.|
|../…./..|
+=*=*=*=*=*=*+
|//////|
|.//..//.|
|../…./..|
|../…./..|
|.//..//.|
|//////|
+=*=*=*=*=*=*+
/**
//**\
///**\
////**\\
/////**\\
On any given execution, your program will produce just one
version of this figure, but if the constant HEIGHT is changed,
your program produces a figure of a different size. For example,
when HEIGHT is set to 6, the figure would look like the one on the
right:
2
/**
//**\
///**\
////**\\
/////**\\
//////**\\\
///////**\\\
////////**\\\\
/////////**\\\\
//////////**\\\\\
///////////**\\\\\
+=*=*=*=*=*=*=*=*=*=*=*=*+
|…../………./…..|
|….//……..//….|
|…///……///…|
|..////….////..|
|./////../////.|
|////////////|
|////////////|
|./////../////.|
|..////….////..|
|…///……///…|
|….//……..//….|
|…../………./…..|
+=*=*=*=*=*=*=*=*=*=*=*=*+
|////////////|
|./////../////.|
|..////….////..|
|…///……///…|
|….//……..//….|
|…../………./…..|
|…../………./…..|
|….//……..//….|
|…///……///…|
|..////….////..|
|./////../////.|
|////////////|
+=*=*=*=*=*=*=*=*=*=*=*=*+
/**
//**\
///**\
////**\\
/////**\\
//////**\\\
///////**\\\
////////**\\\\
/////////**\\\\
//////////**\\\\\
///////////**\\\\\
CSS142: Homework: Loops – Rockets
Work Items
Write the program described below. Submit the single Java file (i.e., “.java” text file) that contains your
program:
(a) Please submit only a single Java file via Canvas. Do not email your instructor your work.
(b) Name your Java file LastFirstHWLoops.java, where you put in your own last name and first name for
“Last” and “First”. You must name your file this way.
(c) Recall that this means the name of the public class in your code file must be named LastFirst HW
Loops (again, substituting your own name as appropriate).
About this Document
Course taught at the University of Washington Bothell. Assignment by Michael Stiber, Spring 2012. Some
text by Rob Nash is added in. Additional edits by Johnny Lin, September 2014 and Jeffrey Kim, Summer
2019.
3
Purchase answer to see full
attachment
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.