Results 1 to 2 of 2
  1. #1
    MrFancy is offline Member
    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    Exclamation PLEASE HELP! We're having our project and we need to discuss this code. DIAMOND CLASS

    Please help me how to discuss this, and give me the procedure on how it's made. Help!


    import java.util.Scanner;

    public class Diamond1 {
    public static void main(String[] args) {
    System.out.print("Enter the number of stars you want in diamond shape: ");
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    System.out.println("Diamond of Stars are \n");
    for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (n - i); j++)
    System.out.print(" ");
    for (int j = 1; j <= i; j++)
    System.out.print("*");
    for (int k = 1; k < i; k++)
    System.out.print("*");
    System.out.println();
    }

    for (int i = n - 1; i >= 1; i--) {
    for (int j = 0; j < (n - i); j++)
    System.out.print(" ");
    for (int j = 1; j <= i; j++)
    System.out.print("*");
    for (int k = 1; k < i; k++)
    System.out.print("*");
    System.out.println();
    }

    System.out.println();
    }

    }

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: PLEASE HELP! We're having our project and we need to discuss this code. DIAMOND C

    I would have stuck code tags round that, but it appears it's all unformatted anyway.
    It's not exactly easy to follow the flow of unformatted code.

    Anyway, where did this code come from?
    What are you expected to dicsuss?
    What do you not understand about the code?
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 7
    Last Post: 09-15-2013, 04:56 AM
  2. Inheritance - a tricky program -lets discuss
    By j_arif123 in forum New To Java
    Replies: 5
    Last Post: 03-09-2013, 06:03 PM
  3. hello, got a fun project to discuss
    By lorenzop in forum Introductions
    Replies: 0
    Last Post: 10-27-2012, 12:36 PM
  4. Let's discuss about Alfresco Labs
    By java-walker in forum Web Frameworks
    Replies: 0
    Last Post: 04-20-2009, 08:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •