Pages

Friday, 1 April 2016

Chapter 1 Exercise 3, Introduction to Java Programming, Tenth Edition Y. Daniel LiangY.

(Display a pattern) 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
         JJ  A     A  V  A     A
public class Exercise_03 {

    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  V V  AAAAA");
        System.out.println(" JJ  A     A  V  A     A");
    }
}

No comments:

Post a Comment