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

Thread: How would I write this program?

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How would I write this program?

    I have this programming assignment which calls for:
    1) The user to enter a file to use.
    2) Then the user enters a particular sub string to search for.
    3) The object of the program would be count the number of occurrences of the particular sub string in the file.
    I am a rookie programmer so I am really lost
    I managed to get steps 1 and 2 complete, but I need help with step 3.
    *** My teacher says that I can only use the charAt and length method of the String class.


  2. #2
    Super Moderator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,225
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: How would I write this program?

    Break the problem down. Sit down with a pen and paper, and write down how you would do this step by step. Once you've done this, concentrate on the code for each step. See How to Program (stuck on homework? READ THIS BEFORE POSTING)

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How would I write this program?

    thanks for the advice, I'll keep this in mind while constructing my pseudocode.

Similar Threads

  1. help me write java program
    By stevisto in forum Member Introductions
    Replies: 1
    Last Post: September 13th, 2011, 03:44 PM
  2. Program to read & write the Employee Records
    By arvindk.vij in forum Member Introductions
    Replies: 1
    Last Post: February 11th, 2011, 12:19 AM
  3. Program to read & write the Employee Records
    By arvindk.vij in forum Java Theory & Questions
    Replies: 1
    Last Post: February 11th, 2011, 12:19 AM
  4. how can i write this program
    By lavudyagopi27 in forum Java Theory & Questions
    Replies: 2
    Last Post: September 17th, 2010, 08:11 AM
  5. Someone please help me write a simple program!!!
    By ocean123 in forum Loops & Control Statements
    Replies: 3
    Last Post: June 14th, 2009, 09:46 PM