Monday, June 8, 2015

// // 2 comments

Simple Java Program To Display Shapes With Asterisks

The program below is the answer to Deitel's Java How to Program (9th Edition) Chapter 2 Exercise 2.18. Write an application that displays a box, an oval, an arrow and a diamond using asterisks (*)

/**
 *
 * @author AGHATISE OSAZUWA
 * website: www.cscprogrammingtutorials.com
 */

public class Shapes {
    public static void main (String [] args) {
        System.out.println ("This Application Displays A Box, An Oval, An Arrow"
                + " And A Diamond Using Asterisks (*)");
        
        System.out.print ("*********      ***        *          * \n");
        System.out.print ("*       *    *     *     ***        * * \n");
        System.out.print ("*       *   *       *   *****      *   * \n");
        System.out.print ("*       *   *       *     *       *     * \n");
        System.out.print ("*       *   *       *     *      *       * \n");
        System.out.print ("*       *   *       *     *       *     * \n");
        System.out.print ("*       *   *       *     *        *   * \n");
        System.out.print ("*       *    *     *      *         * * \n");
        System.out.print ("*********      ***        *          * \n");
    }
}

2 comments:


DISCLAIMER: Opinions expressed in comments are those of the comment writers alone and does not reflect or represent the views of the post author. We reserve the right to delete any post deemed inappropriate or offensive and/or spammy. Please do not use abusive words/hate speech.

I Appreciate your valuable Feedback. So, Please DO NOT SPAM - Spam comments will be deleted immediately.

Don't use brand name in name field and you're not allowed to use links in comments unless it's necessary. Such comments will be removed immediately.

Thanks.