0

Can you help me?

How can i write an output like this but with different name size? ************* * mariolina * *************

22nd Oct 2017, 5:57 PM
Giulio Gilardi
Giulio Gilardi - avatar
2 Answers
22nd Oct 2017, 6:26 PM
DragonSl
DragonSl - avatar
+ 1
//just get length of this name change number of asterisks public static void main (String[] args) { String name="SomeNameLikeYouLike"; int l= name.length() + 4; for (int i=0;i<l;i++) System.out.print('*'); System.out.println(); System.out.println('*' + " "+ name + " "+ "*"); for (int i=0;i<l;i++) System.out.print('*'); System.out.println(); }
22nd Oct 2017, 6:58 PM
Petr Hatina
Petr Hatina - avatar