Question
Create a program that will use nested loops to create the following 3 star designs. Use the attached skeleton below as a template. ( JAVA
Create a program that will use nested loops to create the following 3 star designs. Use the attached skeleton below as a template. ( JAVA )
Please do not use any other methods. Please do not use nString or any other helper methods.
For star design 3 and 4 , nested loops are required to use
Star Design #1:
**** *** ** *
Star Design #2: * ** *** **** *****
Star Design #3: *
**
***
****
*****
Star Design #4: The diamond below represents a single asterisk at the 4th position on the first row, then on the second row there are 3 asterisks starting at 3rd position. The third row has 5 asterisks starting at the 2nd position, and the fourth row has 7 asterisks starting at the 1st position. The fifth row is like the third row, and the sixth row is like the second row, while the seventh row is like the first row.
* *** ***** ******* ***** *** *
package solvingstardesigns;
public class SolvingStarDesigns {
/** * @param args the command line arguments */ public static void main(String[] args) { //Instantiate the driver class, so you can call instance methods (& not static methods) SolvingStarDesigns myStars = new SolvingStarDesigns(); myStars.makeDesign1(); myStars.makeDesign2(); myStars.makeDesign3(); myStars.makeDesign4(); } /** * Use javadoc tags to document each method: */ public void makeDesign1() { //put your code here } /** * Use javadoc tags to document each method: */ public void makeDesign2() { } /** * Use javadoc tags to document each method: */ public void makeDesign3() { } /** * Use javadoc tags to document each method: */ public void makeDesign4() { } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started