Need help with Java Programming assignments!!

Discussion in 'Java' started by JFizzR, Nov 29, 2003.

  1. JFizzR

    JFizzR Guest

    I need a number of things here to catch up with my java programming
    class, and I turn to you guys, the experts, for help...

    Does anyone happen to have a program that will turn a string of
    characters based on ASCII to binary, and back again? (using 2-16 for
    the binary...)
    Second I'm looking for some help on a program witch isn't an applet,
    yet an application that will ask for input of Hit, Stand, Draw for a
    game of blackjack i.e. 21... so far I've figured the main idea would
    be if hand<21 execute input,,,else bust

    also have questions with a few other of my labs such as method
    overloading.. does anyone know how to add strings of numbers,, ex:
    12,4,5,6,6 = 34,, but using the charAt() and such... I've got most of
    the code written, I just can't figure out how to add them together...
    how does it know when there's a number or a comma??? some kind of
    loop,,.. help :(

    Last but not least... Area 51... I have to make an applet that puts up
    a grid of long/lat. ,, blue background, and 5 island using the
    g.drawPolygon.. easy enough, and I have all of that applet written,
    but the problem is,, you have to have a button to show a UFO on the
    screen, that moves, but a button controls the movement and you must
    record the speed and all that jazz with it.. if you want, I can get
    you a link to all the rules etc...

    Someone please help me out here,,, i'm really stuck and I can't figure
    any of this shit out... Thanks!!!

    JFizzR
     
    JFizzR, Nov 29, 2003
    #1
    1. Advertisements

  2. JFizzR

    Jose Rubio Guest

    We're not Santa Claus. Go to the mall and sit on his lap. Maybe he can help
    you out!!!

    Jose
     
    Jose Rubio, Nov 29, 2003
    #2
    1. Advertisements

  3. Presumably you [or maybe your parents] pay for your education. So why waste
    your course fees by not doing the assigned work [in a timely fashion], and
    trying to learn the stuff ?

    Catch up on about four course assignments - you've got to be kidding ? Good
    luck digging yourself out of this mess - I doubt anyone here is going to
    help.

    Anthony Borla
     
    Anthony Borla, Nov 29, 2003
    #3
  4. JFizzR

    Jeffrey Palm Guest

    Switch majors.

    Jeff
     
    Jeffrey Palm, Nov 29, 2003
    #4
  5. JFizzR

    Roedy Green Guest

    Roedy Green, Nov 29, 2003
    #5
  6. JFizzR

    Roedy Green Guest

    Roedy Green, Nov 29, 2003
    #6
  7. JFizzR

    Roedy Green Guest

    You have strings. Convert them to ints. See
    http://mindprod.com/converter.html
    add them to your total as you go.
     
    Roedy Green, Nov 29, 2003
    #7
  8. JFizzR

    Roedy Green Guest

    See http://mindprod.com/product.html#SCREWS
    for an example of a basic drawing program.

    I think you are going to flunk this course because if you have let
    yourself get so far behind, and if you can't add up some numbers, you
    have no hope of solving this one. If you try this course again next
    year, don't think you can cram at the last minute like you can a
    history exam. It is simply impossible. You have to work a little at
    it each day.
     
    Roedy Green, Nov 29, 2003
    #8
  9. JFizzR

    Jay O'Connor Guest


    One of those cases where I think to myself...."Do I really want to help
    this person become a member of my profession?"
     
    Jay O'Connor, Nov 30, 2003
    #9
  10. JFizzR

    JFizzR Guest


    My parents don't pay for my education, I do... my problem is, I had my
    computer serviced because the motherboard fried.. it's a brand new
    dell,, who knows,, anyway... instead of taking 3-5 days, it took 17
    days to fix.. yes, 17 days.. this put me SOOO far behind on the class,
    I have no other option other than to turn to you guys for help.. I do
    appreciate the sites, and I will check them out...

    I'm not sure who said change my string to an int to add them
    together,,, but,, this would be the easy way,,, the assignment calls
    for me to add the numbers together AS A STRING... it's a pain in the
    ass...

    Please don't think i'm lazy guys,, i've tried to understand this stuff
    from the notes I took while I didn't have my computer, with no
    avail... not only did I get 5 assignments behind during this downtime,
    but of course I get the regular 2 assignments a week tacked on...

    I'm not one to ask internet people for help, but I know there's many
    talented programmers out there that may be able to show me door so I
    may walk through... Thanks again for your help guys, I hope this
    clears things up a bit
     
    JFizzR, Nov 30, 2003
    #10
  11. JFizzR

    nos Guest

    so why didn't you go to the computer lab when your
    machine was busted
    (i suppose you are going to reply that it doesn't have what you need)
     
    nos, Dec 1, 2003
    #11
  12. JFizzR

    Sudsy Guest

    Don't presuppose. Whatever the TRUE situation of this poor soul,
    plaintive requests for assistance have apparently fallen on
    cynical ears.
    That's not really surprising as the requests for homework help
    rise and fall in accordance with the academic calendar.
    Blaming vendor X is not likely to result in an outpouring of
    genuine offers of assistance.
    OTOH, there are obviously a lot of really smart people who
    lurk on this newsgroup. Offer up a challenge, demonstrate that
    you've made an effort and you might be surprised and edified
    by those individuals.
    I guess it comes down to asking the right questions... ;-)
     
    Sudsy, Dec 1, 2003
    #12
  13. JFizzR

    jb Guest


    pseudo code...work the details out for yourself.
    string str = "1,2,3,4,5,6";

    vector<int> nums = tokenize(str); // write this func youself

    for(...nums.size..);
    sum += nums;
     
    jb, Dec 1, 2003
    #13
  14. Your best bet is to do the following three things.

    1. Go to your instructor, and ask for an extension. He/she likely does
    not care about your tale of woe, but is probably more interested in
    having you learn the material than cheat. I, at least, found that my
    teachers never cared much about _why_ I wanted another few weeks, but
    they _always_ gave such extensions on the four occasions I remember
    asking for them in college. Had they wanted to know, I would have told
    them, but they really just wanted me to learn the material.

    2. Look at each of your assignments as a chance to learn the topic it
    is to present. If we give you the answer to one of these early ones,
    you will not now it later. A good hint, on the other hand, might help
    you understand enough now to be able to do the later stuff.

    3. Now that you have the time and the energy to do each assignment,
    break them down. Start with the easiest, which is likely the first.
    See how much you can do on your own, which includes typing in some code
    and running it. If you do not know how to do a specific task, put in a
    line like "System.out.println("Turn '1,2,12' into the ints 1, 2, and 12,
    then add and convert the resulting 15 back into the string '15'");

    This is your pseudo code, and forms the basis of a real question.

    4. You will hit a wall. We all do. At that point, ask for specific
    help. For example:

    "The attached program will turn '1','2','12' into the strings '1', '2',
    and '12', but I have no idea how to add those strings to get 15. Do I
    have to convert it to an int?"

    You will then be much more likely to get actual help. For instance, I
    could rattle off the top of my head the answer to the three or four
    questions I suspect you will have about this problem, but if I guess
    wrong about your questions, you will not be helped.

    Starting point:
    1. How to break up a string into substrings based on a delimiter
    2. How to interpret each one as an int
    3. How to add those ints
    4. How to convert back.

    Try to write the program that does these four things, and see where you
    run into difficulty. Post your code, what you think it should do, and
    what it actually does.

    Scott

    Java, Cocoa, WebObjects, and Database consulting
     
    Scott Ellsworth, Dec 1, 2003
    #14
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.