Question: package code; public class AssignmentOne { public static void main(String[]args) { System. out .println(* * * * * *); System. out .println(*); System. out .println(*);

packagecode;

publicclassAssignmentOne {

publicstaticvoidmain(String[]args) {

System.out.println("* * * * * *");

System.out.println("*");

System.out.println("*");

System.out.println("* * * * * *");

System.out.println(" *");

System.out.println(" *");

System.out.println("* * * * * *");

System.out.println("*");

System.out.println("*");

System.out.println("* * * * * *");

System.out.println(" *");

System.out.println(" *");

System.out.println("* * * * * *");

System.out.println("*");

System.out.println("*");

}

}

Use Java methods to eliminate redundancy, with a goal of making the program as small as possible. In this assignment your main() method should only contain calls to other methods, though in general that is not a good strategy. My solution uses 3 methods other than main.

My question is how do I eliminate redundacy to my solution while making it work?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!