Banner with centre align - Java Quiz Question



Write a program to create banner with centre align text. Leave 2 extra spaces on the right and left sides as margin. Use System.out.print or System.out.println for printing.

Input (String, Banner Width) Printed Output
Ananda Venkata Ratna Sabapathi Rao, 15 *********************
#                   #
#  Ananda Venkata   #
#  Ratna Sabapathi  #
#        Rao        #
#                   #
*********************
Siva Rama Krishna Nookala, 10 ****************
#              #
#  Siva Rama   #
#   Krishna    #
#   Nookala    #
#              #
****************
Sun rises in the east and sets in the west, 12 ******************
#                #
#  Sun rises in  #
#  the east and  #
#  sets in the   #
#      west      #
#                #
******************
Tit for tat, 8 **************
#            #
#  Tit for   #
#    tat     #
#            #
**************

class BannerWithCentreAlign

{    public static void main(String s[])
    {
        createBanner("Ananda Venka Ratna Sabapathi Rao", 15);

    }


public static void createBanner(String name, int rectWidth) {
//Write code here to create banner with centre align.
}

//Use this for writing additional methods if required
}