Question: public class GreenvilleMotto { public static void main ( String [ ] args ) { / / Define the motto String motto = The stars
public class GreenvilleMotto
public static void mainString args
Define the motto
String motto "The stars shine in Greenville.";
Determine the length of the border including spaces
int borderLength motto.length; asterisks on each side
Display the top border
for int i ; i borderLength; i
System.out.print;
System.out.println; Move to the next line
Display the motto with borders
System.out.println motto ;
Display the bottom border
for int i ; i borderLength; i
System.out.print;
System.out.println; Move to the next line
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
