Monday, 30 October 2017

Introduction to Java program



Problem 1.3
                     Write a program that displays the following pattern:
        J          A             V        V        A
         J         A A            V     V        A A
    j    J       AAAAA          V V        AAAAA
     J J       A           A         V        A           A

Discripition:
                    By using tabs in SOP(System.out.println()) display this message
Solution:
               public class Message {

    public static void main(String[] args) {
      
        System.out.println("  J      A       V       V    A");
         System.out.println(" J     A A       V   V    A  A");
        System.out.println("J J   AAAAA   VV   AAAAA");
        System.out.println(" JJ   A         A    V    A        A");
    }   
}

Output:
                     


No comments:

Post a Comment