Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9300107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:42:34+00:00 2026-06-18T22:42:34+00:00

I am stuck on this one problem on Arrays. I haven’t started the program

  • 0

I am stuck on this one problem on Arrays. I haven’t started the program yet because I really don’t understand what it wants me to do! Here is the problem:

Write a method called wordLengths that accepts a String representing a file name as its argument. Your method should open the given file, count the number of letters in each token in the file, and output a result diagram of how many words contain each number of letters. For example, the following text:

Before sorting:

12 23 480 -18 75

hello how are you feeling today

After sorting:

-18 13 23 75 480

are feeling hello how today you

your method should produce the following output to the console:

1: 0    

2: 6    [There should be 6 * printed here]

3: 10   [There should be 10 * printed here]

4: 0

5: 5    [There should be 5 * printed here]

6: 1    [There should be 1 * printed here]

7: 2    [There should be 2 * printed here]

8: 2    [There should be 2 * printed here]

So StackOverflow is rather limited, so I wasn’t able to show you the full style of the output, but in summary, the “Before Sorting:” part that is followed by 2 sentences are one group, “After sorting:” and the 2 sentences below are another group. The “before” and “after” sorting are separated by one space.

I don’t get how the output is achieved, that’s my problem. I have a feeling that the 1-8 represents line numbers, but what do the 0, 6, 10, etc. represent? Because when I counted the word lengths, they exceeded 6 or 10…
It’d be a great help if someone could explain to me what this program wants me to do.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:42:36+00:00Added an answer on June 18, 2026 at 10:42 pm

    1 – 8 are length of a word (or a number, or a token); -18 has length 3, and “sorting:” is 8.

    0, 6, 10… are the number of occurrences for words that have the length 1, 2, 3…

    BTW, this is not really a question fitting here but hope this could help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing a cookbook website and I am stuck on this one problem.
I am stuck on this one piece of code because I can't get the
So the problem.. I have been stuck with this one for a good month
I'm stuck for ideas on this one. I'm working on a CMS that uses
This is probably a simple one to answer, but I'm stuck, so here goes.
Im stuck with this little project in C# but basically my problem is this:
I'm kind of stuck with one - presumably simple to resolve problem. I want
I hope this isn't too vague, but I'm stuck on a problem that has
im stuck in this terrible problem, I have a SOAP based webservice implemented in
i've been stuck with this problem for like a day, not finding any relevant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.