I really need help with this so if anyone can help me out that wouldbe really great of you.

Discussion in 'Java' started by adityagaddam90@gmail.com, Feb 6, 2008.

  1. Guest

    I am a student studying in college this is my first year and i am
    taking Computer Science as my Major but i am having a hard time with
    my course. I have no idea of whats going on in class so if any 1 knows
    anything about this things i have to do please help me out.

    the professor gave us this to do and i am having some trouble with
    this so plz help me out on what to do here.

    Part I

    Write a program that prints the following pattern:

    *
    ***
    *****
    *******
    *****
    ***
    *

    Part II

    To make a profit a local store marks up the prices of its items by
    25%. Write a Java program that declares the following variables:
    1. a double variable named percent_markedup
    2. a double variable named original_price
    3. a double variable named sales_tax_rate


    In your program be sure to assign a value to each of the variables 1-3
    above. Use initialization for 1 and 2 and for 3.

    Using the information from above, the program should then output:
    1. the original price of the item
    2. the marked-up percentage of the item (original price times percent
    of markup)
    3. the store's selling price of the item
    4. the sales tax rate
    5. the sales tax
    6. the final price of the item (the final price of the item is the
    selling price plus the sales tax)



    can u send me an email or using this to communicate. My email is
    . thx a lot
    , Feb 6, 2008
    #1
    1. Advertising

  2. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    > I am a student studying in college this is my first year and i am
    > taking Computer Science as my Major but i am having a hard time with
    > my course. I have no idea of whats going on in class so if any 1 knows
    > anything about this things i have to do please help me out.
    >
    > the professor gave us this to do and i am having some trouble with
    > this so plz help me out on what to do here.


    See http://home.earthlink.net/~patricia_shanahan/beginner.html for my
    advice on this situation.

    Patricia
    Patricia Shanahan, Feb 6, 2008
    #2
    1. Advertising

  3. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 6, 10:11 am, wrote:
    >  I am a student studying in college this is my first year and i am
    > taking Computer Science as my Major but i am having a hard time with
    > my course. I have no idea of whats going on in class so if any 1 knows
    > anything about this things i have to do please help me out.
    >
    > the professor gave us this to do and i am having some trouble with
    > this so plz help me out on what to do here.


    <http://home.earthlink.net/~patricia_shanahan/beginner.html>

    > ...can u send me an email


    No this is not a helpdesk, it is a public forum.
    And can you please take more effort to spell words fully?

    >..or using this to communicate. My email is
    > .


    'You have spam!' It is best not to post your email
    address clearly on the internet, but I suppose for a
    GG poster, it makes little difference.

    --
    Andrew T.
    PhySci.org
    Andrew Thompson, Feb 6, 2008
    #3
  4. Mark Space Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    > I am a student studying in college this is my first year and i am
    > taking Computer Science as my Major but i am having a hard time with
    > my course. I have no idea of whats going on in class so if any 1 knows
    > anything about this things i have to do please help me out.


    I'm just curious: is this your first programming class ever or are you
    taking a second or later course now?

    Patricia gave pretty good advice. The only things I would add are:

    1. Talk to your professor during office hours, or just before or just
    after class. You may not be the only one having these problems.

    2. Go to your computer lab and ask the assistants. Often, that's why
    they are there. If not (they can't or won't help you), try to find out
    if there's a lab with assistants who are available for instruction.
    Mark Space, Feb 6, 2008
    #4
  5. Daniel Pitts Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    > I am a student studying in college this is my first year and i am
    > taking Computer Science as my Major but i am having a hard time with
    > my course. I have no idea of whats going on in class so if any 1 knows
    > anything about this things i have to do please help me out.
    >
    > the professor gave us this to do and i am having some trouble with
    > this so plz help me out on what to do here.
    >

    [snip problem descriptions]
    >
    > can u send me an email or using this to communicate. My email is
    > . thx a lot


    My suggestion to you is to post what you've already tried, and what went
    wrong with it. We won't do your homework for you here, but many of us
    will help you understand it and make it happen.

    --
    Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
    Daniel Pitts, Feb 6, 2008
    #5
  6. Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 5, 7:24 pm, Mark Space <> wrote:
    > wrote:
    > > I am a student studying in college this is my first year and i am
    > > taking Computer Science as my Major but i am having a hard time with
    > > my course. I have no idea of whats going on in class so if any 1 knows
    > > anything about this things i have to do please help me out.

    >
    > I'm just curious: is this your first programming class ever or are you
    > taking a second or later course now?
    >
    > Patricia gave pretty good advice. The only things I would add are:
    >
    > 1. Talk to your professor during office hours, or just before or just
    > after class. You may not be the only one having these problems.
    >
    > 2. Go to your computer lab and ask the assistants. Often, that's why
    > they are there. If not (they can't or won't help you), try to find out
    > if there's a lab with assistants who are available for instruction.


    yes this is my first programming class ever.
    , Feb 6, 2008
    #6
  7. Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 5, 8:07 pm, Daniel Pitts
    <> wrote:
    > wrote:
    > > I am a student studying in college this is my first year and i am
    > > taking Computer Science as my Major but i am having a hard time with
    > > my course. I have no idea of whats going on in class so if any 1 knows
    > > anything about this things i have to do please help me out.

    >
    > > the professor gave us this to do and i am having some trouble with
    > > this so plz help me out on what to do here.

    >
    > [snip problem descriptions]
    >
    >
    >
    > > can u send me an email or using this to communicate. My email is
    > > . thx a lot

    >
    > My suggestion to you is to post what you've already tried, and what went
    > wrong with it. We won't do your homework for you here, but many of us
    > will help you understand it and make it happen.
    >
    > --
    > Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>


    hey Daniel like you have said i tried doing this for part 1 and i
    didnt get it right so can u tell me what i have done wrong here.

    public class Stars
    {
    public static void main(string [] args)
    {
    System.out.println( * );
    System.out.println( *** );
    System.out.println( ***** );
    System.out.println(*******);
    System.out.println( ***** );
    System.out.println( *** );
    System.out.println( * );
    }
    }
    , Feb 6, 2008
    #7
  8. Stefan Ram Guest

    Re: I really need help with this so if anyone can help me out that would be really great of you.

    writes:
    > *
    > ***
    > *****
    > *******
    > *****
    > ***
    > *


    public class Main
    { public static void main( final java.lang.String[] args )
    { java.lang.System.out.println
    ( java.lang.String.format
    ( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
    0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}

    *
    ***
    *****
    *******
    *****
    ***
    *
    Stefan Ram, Feb 6, 2008
    #8
  9. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    Stefan Ram wrote:
    > writes:
    >> *
    >> ***
    >> *****
    >> *******
    >> *****
    >> ***
    >> *

    >
    > public class Main
    > { public static void main( final java.lang.String[] args )
    > { java.lang.System.out.println
    > ( java.lang.String.format
    > ( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
    > 0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}
    >
    > *
    > ***
    > *****
    > *******
    > *****
    > ***
    > *
    >


    This seems just a little bit more subtle in its use of advanced features
    than I would recommend for the OP's current situation.

    Patricia
    Patricia Shanahan, Feb 6, 2008
    #9
  10. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    ....
    > hey Daniel like you have said i tried doing this for part 1 and i
    > didnt get it right so can u tell me what i have done wrong here.
    >
    > public class Stars
    > {
    > public static void main(string [] args)
    > {
    > System.out.println( * );
    > System.out.println( *** );
    > System.out.println( ***** );
    > System.out.println(*******);
    > System.out.println( ***** );
    > System.out.println( *** );
    > System.out.println( * );
    > }
    > }


    String literals in Java are enclosed in " marks:

    System.out.println("Some string");

    Patricia
    Patricia Shanahan, Feb 6, 2008
    #10
  11. Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 5, 8:58 pm, Patricia Shanahan <> wrote:
    > wrote:
    >
    > ...
    >
    >
    >
    > > hey Daniel like you have said i tried doing this for part 1 and i
    > > didnt get it right so can u tell me what i have done wrong here.

    >
    > > public class Stars
    > > {
    > > public static void main(string [] args)
    > > {
    > > System.out.println( * );
    > > System.out.println( *** );
    > > System.out.println( ***** );
    > > System.out.println(*******);
    > > System.out.println( ***** );
    > > System.out.println( *** );
    > > System.out.println( * );
    > > }
    > > }

    >
    > String literals in Java are enclosed in " marks:
    >
    > System.out.println("Some string");
    >
    > Patricia


    thank you i will try that and see if it works
    , Feb 6, 2008
    #11
  12. Lew Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    Mark Space <> wrote:
    >> 2. Go to your computer lab and ask the assistants. Often, that's why
    >> they are there. If not (they can't or won't help you), try to find out
    >> if there's a lab with assistants who are available for instruction.


    Not just the assistants. If you have an on-campus lab, just hang out there.
    Take a look around for a few days. Stay low key. Pay attention to who else
    is there all the time. See who attracts advice-seekers, and how they react to
    supplicants.

    When you start asking questions in that room, don't start with the gurus. Ask
    the other supplicants - find out what they learned from the masters. Ask them
    how they plan to use their new-found wisdom. Ask them for advice with your
    problem.

    Yes, the other seekers. The masters will respect you more when you finally do
    approach them. Also, the insight of your fellow students who are at about the
    same stage as you is worth more than you might think, as will your own insight
    be when stimulated by your fellows.

    Don't be too shy about approaching the masters - if they didn't want to answer
    questions they'd hang out somewhere else.

    As to the "stars" problem, a popular one, it seems, forget programming at
    first and concentrate on logic. Look for repetitions, things that happen over
    and over again, perhaps with a different number of stars or spaces each time.
    It's much more important to understand the fundamental logic of the problem
    than how to program it.

    --
    Lew
    Lew, Feb 6, 2008
    #12
  13. Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 5, 8:56 pm, Patricia Shanahan <> wrote:
    > Stefan Ram wrote:
    > > writes:
    > >> *
    > >> ***
    > >> *****
    > >> *******
    > >> *****
    > >> ***
    > >> *

    >
    > > public class Main
    > > { public static void main( final java.lang.String[] args )
    > > { java.lang.System.out.println
    > > ( java.lang.String.format
    > > ( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
    > > 0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}

    >
    > > *
    > > ***
    > > *****
    > > *******
    > > *****
    > > ***
    > > *

    >
    > This seems just a little bit more subtle in its use of advanced features
    > than I would recommend for the OP's current situation.
    >
    > Patricia


    Hey Patricia it worked thank you so much and all others who helped me
    too. I am having problem with the part 2 do you think you can help me
    out on how to start out with.

    Part II

    To make a profit a local store marks up the prices of its items by
    25%. Write a Java program that declares the following variables:
    1. a double variable named percent_markedup
    2. a double variable named original_price
    3. a double variable named sales_tax_rate


    In your program be sure to assign a value to each of the variables 1-3
    above. Use initialization for 1 and 2 and for 3.

    Using the information from above, the program should then output:
    1. the original price of the item
    2. the marked-up percentage of the item (original price times percent
    of markup)
    3. the store's selling price of the item
    4. the sales tax rate
    5. the sales tax
    6. the final price of the item (the final price of the item is the
    selling price plus the sales tax)
    , Feb 6, 2008
    #13
  14. Stefan Ram Guest

    Re: I really need help with this so if anyone can help me out that would be really great of you.

    Patricia Shanahan <> writes:
    >> *
    >> ***
    >> *****
    >>*******
    >> *****
    >> ***
    >> *

    >This seems just a little bit more subtle in its use of advanced features
    >than I would recommend for the OP's current situation.


    Several years ago, I have created a web page with exercise
    regarding loops.

    First, pupils are supposed to draw a line,
    whose length is given as input to the program.

    An example for a run of the program is given as follows.

    length? 20

    ********************

    Next, I try to make them invent nesting of loops
    (which was not mentioned in the class so far):

    width? 17
    height? 4

    *****************
    *****************
    *****************
    *****************

    After some other exercises, comes exactly the same figure as
    in the OP, but with a »height« and width-change specified as
    input to the program at run time:

    height? 4
    increment? 1

    *
    ***
    *****
    *******
    *****
    ***
    *

    And the final exercise is an ellipse:

    half height? 11
    half width? 31

    ********************
    ********************************
    ****************************************
    **********************************************
    ****************************************************
    ******************************************************
    **********************************************************
    ************************************************************
    ************************************************************
    **************************************************************
    **************************************************************
    **************************************************************
    **************************************************************
    ************************************************************
    ************************************************************
    **********************************************************
    ******************************************************
    ****************************************************
    **********************************************
    ****************************************
    ********************************
    ********************

    This usually is too hard for the pupils at this level, but
    there sometimes might be pupils who are exceptionally gifted
    and want more difficult exercises.

    ( The URI of my German langauge with those exercises is as follows.

    http://www.purl.org/stefan_ram/pub/programmieren_aufgabe_iteration_de

    )
    Stefan Ram, Feb 6, 2008
    #14
  15. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    ....
    > Hey Patricia it worked thank you so much and all others who helped me
    > too. I am having problem with the part 2 do you think you can help me
    > out on how to start out with.


    Work step-by-step through the instructions, doing each thing you are
    told to do. Pay attention to the other advice you have received about
    using your professor, teaching assistants etc.

    I can't help you directly with this, because you have given me nothing
    to go with.

    Patricia
    Patricia Shanahan, Feb 6, 2008
    #15
  16. Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    On Feb 5, 9:23 pm, Patricia Shanahan <> wrote:
    > wrote:
    >
    > ...
    >
    > > Hey Patricia it worked thank you so much and all others who helped me
    > > too. I am having problem with the part 2 do you think you can help me
    > > out on how to start out with.

    >
    > Work step-by-step through the instructions, doing each thing you are
    > told to do. Pay attention to the other advice you have received about
    > using your professor, teaching assistants etc.
    >
    > I can't help you directly with this, because you have given me nothing
    > to go with.
    >
    > Patricia


    ok well thx for at lest helping me out with something.
    , Feb 6, 2008
    #16
  17. Lew Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:
    > ok well thx for at lest helping me out with something.


    How very gracious. Except for that "at least" part - it actually sounds
    rather sulky.

    You have received excellent advice, particularly from Patricia, who has given
    you the keys to excel in your course. I should think you'd be exulting with
    gratitude, most especially toward her.

    Please avoid textspeak in Usenet posts.

    --
    Lew
    Lew, Feb 6, 2008
    #17
  18. Mark Space Guest

    Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    wrote:

    >> This seems just a little bit more subtle in its use of advanced features
    >> than I would recommend for the OP's current situation.
    >>
    >> Patricia

    >
    > Hey Patricia it worked


    *whoosh*

    And the point goes flying over your head, I'm sorry to have to say.

    These programs look a bit rough actually for a first class. Maybe
    there's some parts of the lecture that will discuss these issues still
    to come?

    The first part of Part II should be easy to get though, try to get at
    least that much.
    Mark Space, Feb 6, 2008
    #18
  19. Re: I really need help with this so if anyone can help me out thatwould be really great of you.

    Stefan Ram wrote:
    > writes:
    >> *
    >> ***
    >> *****
    >> *******
    >> *****
    >> ***
    >> *

    >
    > public class Main
    > { public static void main( final java.lang.String[] args )
    > { java.lang.System.out.println
    > ( java.lang.String.format
    > ( "%15.0f\n%16.1f\n%17.3f\n%18.5f\n%17.3f\n%16.1f\n%15.0f\n",
    > 0., 0., 0., 0., 0., 0., 0. ).replaceAll( "\\S", "*" )); }}
    >
    > *
    > ***
    > *****
    > *******
    > *****
    > ***
    > *
    >


    Without any comment on why you wrote it that way, this is quite
    dangerous, me thinks. If the OP were to blindly copy and submit it (as
    many beginners are tempted to), (s)he is bound to get into trouble for
    it (if the tutors are worth their salt). Which just might discourage
    her/him, unnecessarily.

    /W
    Wildemar Wildenburger, Feb 6, 2008
    #19
  20. Re: I really need help with this so if anyone can help me out that would be really great of you.

    On Wed, 06 Feb 2008 09:37:00 +0100, Wildemar Wildenburger wrote:
    > Without any comment on why you wrote it that way, this is quite
    > dangerous, me thinks. If the OP were to blindly copy and submit it (as
    > many beginners are tempted to), (s)he is bound to get into trouble for
    > it (if the tutors are worth their salt). Which just might discourage
    > her/him, unnecessarily.


    There is a long standing Usenet tradition of providing technically
    correct but obfuscated, advanced or otherwise "unlikely" solutions to
    homework questions.

    It's something the OP needs to deal with, and is IMO an important part
    of the learning process if he comes here with questions that show a
    complete lack of effort to solve the problem himself.

    /gordon

    --
    Gordon Beaton, Feb 6, 2008
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    1
    Views:
    396
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 1, 2004
  2. Miguel Dias Moura
    Replies:
    2
    Views:
    340
    Martin
    Jun 22, 2004
  3. Replies:
    1
    Views:
    326
    dorayme
    Aug 3, 2006
  4. Eric I.
    Replies:
    0
    Views:
    255
    Eric I.
    Oct 5, 2008
  5. smerf

    Really great Javascript Toolkits?

    smerf, Oct 22, 2006, in forum: Javascript
    Replies:
    2
    Views:
    70
    smerf
    Oct 23, 2006
Loading...

Share This Page