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

Thread: computer science help

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default computer science help

    and i'm having problems remembering syntax. does anyone think they could help me?
    a drunk is placed at the center of a 7 m bridge. each steps he moves one meter forward or one step back wards. i need to write a program that will determine how many steps the drunk will take before falling off the bridge. it needs to display the bridge for every stage of the trip. it needs to do this 50 times and display the average and greatest number of steps. all help is appreciated!


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

    Default Re: computer science help

    The Java tips and snippets forum is reserved for tips/snippets you're providing for others

    I've moved this topic into an appropriate forum.

    What have you done so far (code, pseudo or Java)? If you're unsure where to start, I'd recommend reading through the Java Language Tutorials.

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,696
    Thanks
    25
    Thanked 334 Times in 310 Posts

    Default Re: computer science help

    each steps he moves one meter forward or one step back wards

    Ok, so is each step 1 meter?

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,824
    Thanks
    55
    Thanked 2,344 Times in 2,315 Posts

    Default Re: computer science help

    determine how many steps the drunk will take before falling off the bridge.
    Use a Random number to determine which direction. Increment/decrement the location until off the bridge.

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,824
    Thanks
    55
    Thanked 2,344 Times in 2,315 Posts

    Default Re: computer science help


  6. #6
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: computer science help

    Why do you guys have to point out all the cross posting? It's not illegal in this forum?

  7. #7
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,355
    Thanks
    182
    Thanked 833 Times in 776 Posts
    Blog Entries
    5

    Default Re: computer science help

    Quote Originally Posted by javapenguin View Post
    Why do you guys have to point out all the cross posting? It's not illegal in this forum?
    There are many reasons. First, the question may already be answered somewhere else, and without knowing one can waste their time trying to help out to solve a problem that is already solved. Second, and this just recently happened in these forums - a discussion in another cross post had important information which another forum did not - leaving many rehashing and asking the same questions. Third, its redundant information - doing a google search on your problem to try and find an answer only to bring up several forums with the same question being asked and not knowing where the answer lies (or it there is an answer) can be frustrating. Fourth, it can be considered rude and selfish for a poster to neglect any of the issues above. It may not be 'illegal' in this forum, but it is polite to post links to other places where the identical question was asked. It is understandable if new users aren't aware of the issues outlined above, but it is also important they be made aware of those issues and the policies of this and other forums.
    Last edited by copeg; November 4th, 2010 at 05:14 PM.

  8. The Following User Says Thank You to copeg For This Useful Post:

    javapenguin (November 4th, 2010)

Similar Threads

  1. Making computer independent file path
    By Javabeginner in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: September 2nd, 2010, 04:56 PM
  2. List serial com ports of computer
    By mickey in forum Java Networking
    Replies: 2
    Last Post: August 6th, 2010, 02:44 AM
  3. Funny computer and office related cartoons
    By Flash in forum The Cafe
    Replies: 6
    Last Post: April 9th, 2010, 05:13 AM
  4. Database in a standalone computer
    By Abednego Setyawan in forum JDBC & Databases
    Replies: 1
    Last Post: April 7th, 2010, 10:24 PM
  5. Code wise working of Computer Algebra Systems
    By helloworld922 in forum Java Theory & Questions
    Replies: 1
    Last Post: July 7th, 2009, 08:45 AM

Tags for this Thread