John is a novice biological statistician. His first assignment given to him by his mentor, Mrs Jane, is to conduct a survey on 30 exotic plants and to note the number of flowers they produce during a period of one month.
The results collected as as follows:!
0   1   1   3   3   3
2   4   2   1   5   0
1   2   4   5   4   3
1   1   3   1   0   1
1   2   4   1   2   1

Since John knows that he will have to conduct such surveys frequently, he is intending to have a program which will accept data (as shown above) as inputs and then output the data in the form of a frequency table as shown below.
x   0   1   2   3   4   5
f   3   11  5   5   4   2

The program should also output the mean, median and range.

I take it John is not a programmer. I think John would pull up Excel or if not having that go get Libre Office and make a spreadsheet to create the report. No programming is required here.

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here.

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you.

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"

Post what you have done so far and someone will help you from there.

i am extremly sorry, as i did not realize that it would come out to be rude without explaing my problem.
i apologize.

my issue is that can someone please just explain how to begin this question as i have tried looking for several java tutorials on different places but am unable to find any related thing.

any help would be really really appreciated.


You can use a Scanner to read the data from the user, then store it into an array or arrays.
You can use loops to go through all the data in the array(s) to perform the calculations, the print the results to System.out

commented: thankyou sooo much, +0

While this is a programming forum there are some problems that are easily solved with off the shelf apps.

Not only would an app be the wrong solution but the typical app would at first require you to input all the data, not let you edit a mistaken entry and more.

Your question would have the real world solution and answer to use a spreadsheet since Ms. Jane can audit their work and formulas without being a programmer.

Come on guys! This is obviously a teaching exercise in a Java course, so comments about using spreadsheets or off the shelf applications are hardly relevant.

I only see a Java tag but little more about this needing code written. I re-read the OP's question and it clearly called solving the question. Maybe they left out a lot of the spec or wanted folk to write the app for them. It would have been clearer if they had shared their attempt at the code and shared where they had trouble.

The problem statement needs work. And in there should be some way to avoid having to start over inputing those 30 sample sets. Again the free spreadsheet wins solving the presented problem.

correct. The problem statetement merely tells to solve the problem, not how to solve it :)
And for this kind of thing a spreadsheet is the easiest way to go, it's exactly what spreadsheets were designed to do...