Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Java Homework

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java Homework

    How can I write a Java program that shows these patterns by getting input from the user with character input and integer input.
    ****
    ***
    **
    *
    *_*
    *_ _*
    *_ _ _*

    also:

    $$$$
    $$$
    $$
    $
    $$
    $_$
    $_ _$
    $_ _ _$
    $_ _ _ _$


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java Homework


  3. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java Homework

    I have tried this much.
    import java.util.Scanner;



    /**This program displays a diamond pattern with the input gathered from user
    */


    public class DiamondPattern {


    public static void main(String[] args)
    {
    //Create a Scanner object for keyboard input.
    Scanner keyboard = new Scanner(System.in);

    //Get the character input from user.
    System.out.print("Please enter what charecter you will be using?");

    //Get integer input from user between 1-10.
    System.out.print("Please enter the number for the size you want your diamond to be.");






    }
    }

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Java Homework

    Please read the announcements at the top of every forum to learn how to wrap code in the code tags.

    I have tried this much.
    Do you have a question?

Similar Threads

  1. Java homework
    By Nabeel in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 24th, 2013, 09:04 AM
  2. Replies: 8
    Last Post: February 12th, 2013, 05:45 AM
  3. New to Java. Need help with homework
    By ptison in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 26th, 2013, 05:53 PM
  4. JAVA HOMEWORK HELP!
    By javafirsttime in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 14th, 2011, 07:00 PM
  5. New to Java Need help with Homework
    By cjg2283 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: October 20th, 2011, 09:47 PM