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 5 of 5

Thread: Need Help with my hmwk! Java noob!

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Help with my hmwk! Java noob!

    Hey Guys,

    This is my first full week in my first computer software engineering java class. I need some help with my hmwk. I dont understand the for loop concept or and changing the size of the diagram..

    If someone could help me out, that would be great!!!
    __________________________________________________ __________________________________
    In the second part of the assignment, you are going to generate output that looks like the following:
    /**\
    //**\\
    ///**\\\
    ////**\\\\
    /////**\\\\\
    +=*=*=*=*=*=*+
    |../\..../\..|
    |./\/\../\/\.|
    |/\/\/\/\/\/\|
    |\/\/\/\/\/\/|
    |.\/\/..\/\/.|
    |..\/....\/..|
    +=*=*=*=*=*=*+
    |\/\/\/\/\/\/|
    |.\/\/..\/\/.|
    |..\/....\/..|
    |../\..../\..|
    |./\/\../\/\.|
    |/\/\/\/\/\/\|
    +=*=*=*=*=*=*+
    /**\
    //**\\
    ///**\\\
    ////**\\\\
    /////**\\\\\
    You are to reproduce this output exactly. You are to use a class constant to make it possible to change a single number in one place in the program to have it produce a corresponding figure of a different size. The size of the figure above is 3 because various subfigures in the middle of the output have a height of 3. These subfigures have the property that their height determines their width, so there is only one size variable.
    This assignment is meant to give you practice with the constructs from Chapters 1 and 2. This will require you to create nested for loops with print and println statements that use the class constant. You may use constructs from Chapter 3, although you are not required to do so and you will receive no extra credit for doing so. You may not use any programming constructs that are not in Chapters 1 through 3 of the textbook.
    You should continue to use static methods to structure your solution. You should try to avoid significant redundancy and you should structure your program in such a way that the methods match the structure of the output itself. You are required to indent your code properly and will lose points for poor indentation. You should localize variables whenever possible.
    Include a comment at the beginning of your program with basic information and a description of the program and include a comment for each method. Name your file DrawRocket.java and turn in your program electronically through the “assignments” link on the class web page.
    On any given execution your program will produce just one version of this figure, but it should be possible to change the value of the class constant to have your program produce a figure of a different size. For example, with subfigures of height 5, the output should look like the rocket below. (Note: The output-comparison tool on the course web-site has both size rockets.)
    /**\
    //**\\
    ///**\\\
    ////**\\\\
    /////**\\\\\
    //////**\\\\\\
    ///////**\\\\\\\
    ////////**\\\\\\\\
    /////////**\\\\\\\\\
    +=*=*=*=*=*=*=*=*=*=*+
    |..../\......../\....|
    |.../\/\....../\/\...|
    |../\/\/\..../\/\/\..|
    |./\/\/\/\../\/\/\/\.|
    |/\/\/\/\/\/\/\/\/\/\|
    |\/\/\/\/\/\/\/\/\/\/|
    |.\/\/\/\/..\/\/\/\/.|
    |..\/\/\/....\/\/\/..|
    |...\/\/......\/\/...|
    |....\/........\/....|
    +=*=*=*=*=*=*=*=*=*=*+
    |\/\/\/\/\/\/\/\/\/\/|
    |.\/\/\/\/..\/\/\/\/.|
    |..\/\/\/....\/\/\/..|
    |...\/\/......\/\/...|
    |....\/........\/....|
    |..../\......../\....|
    |.../\/\....../\/\...|
    |../\/\/\..../\/\/\..|
    |./\/\/\/\../\/\/\/\.|
    |/\/\/\/\/\/\/\/\/\/\|
    +=*=*=*=*=*=*=*=*=*=*+
    /**\
    //**\\
    ///**\\\
    ////**\\\\
    /////**\\\\\
    //////**\\\\\\
    ///////**\\\\\\\
    ////////**\\\\\\\\
    /////////**\\\\\\\\\
    Last edited by ravij; October 6th, 2009 at 04:29 PM.


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

    Default Re: Need Help with my hmwk! Java noob!

    its supposed to be a rocket...

  3. #3
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: Need Help with my hmwk! Java noob!

    as the people says here.. we cant make the work for you.. do you have any of your codes there...?

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Need Help with my hmwk! Java noob!

    This should get you started
    System.out.println("/**\\\n//**\\\\\n///**\\\\\\\n////**\\\\\\\\\n/////**\\\\\\\\\\\n+=*=*=*=*=*=*+");
    System.out.println("|../\\..../\\..|\n|./\\/\\../\\/\\.|\n|/\\/\\/\\/\\/\\/\\|\n|\\/\\/\\/\\/\\/\\/|\n|.\\/\\/..\\/\\/.|\n|..\\/....\\/..|\n+=*=*=*=*=*=*+\n");
    System.out.println("|\\/\\/\\/\\/\\/\\/|\n|.\\/\\/..\\/\\/.|\n|..\\/....\\/..|\n|../\\..../\\..|\n|./\\/\\../\\/\\.|\n|/\\/\\/\\/\\/\\/\\|\n+=*=*=*=*=*=*+");
    System.out.println(/**\\\n//**\\\\\n///**\\\\\\\n////**\\\\\\\\\n/////**\\\\\\\\\\");

    [/JK]

    But yes, what have you tried?

  5. #5
    Java kindergarten chronoz13's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    659
    Thanks
    177
    Thanked 30 Times in 28 Posts

    Default Re: Need Help with my hmwk! Java noob!

    hehe, thats a shortcut...