conner Statham

Greenhorn

Posts: 2

posted 3 years ago

My problem is where do I start or add the following code to be added?

I only want to use 1 array and may be or should I try a catch block? any help is appreciated in advance...

The number or numbers that were picked least frequently.

The average number of times that all of the numbers were picked. For example, the average might have been 210 times.

The number or numbers that were picked the average number of times.

The number or numbers that were picked most frequently

My problem is where do I start or add the following code to be added?

I only want to use 1 array and may be or should I try a catch block? any help is appreciated in advance...

The number or numbers that were picked least frequently.

The average number of times that all of the numbers were picked. For example, the average might have been 210 times.

The number or numbers that were picked the average number of times.

The number or numbers that were picked most frequently

posted 3 years ago

- 1

First: Welcome to javaRanch, conner.

Why? Have you been

Lesson 2: Don't guess.

Lesson 3: StopCoding (←click) - or rather, in your case, don't

One thing I can tell you is that, in general, the more methods your class has, the better it will be. You've been given 4 tasks to complete, so think about writing 4 methods (at the very least) to do them.

And before you write one line of code for them: THINK.

Take your first task: "[Print out] the number or numbers that were picked least frequently."

What

Also: if you want "number

And do that for all 4 tasks

HIH

Winston

PS: You might be interested in reading the WhereDoIStart page.

conner Statham wrote:I only want to use 1 array

Why? Have you been

*told*that you must? If not, don't start putting constraints on yourself before you even start.and may be or should I try a catch block?

Lesson 2: Don't guess.

`try...catch`blocks are used for a very specific reason; so before you start coding, read up on WHY you might need one.The number or numbers that were picked least frequently.

The average number of times that all of the numbers were picked. For example, the average might have been 210 times.

The number or numbers that were picked the average number of times.

The number or numbers that were picked most frequently

Lesson 3: StopCoding (←click) - or rather, in your case, don't

*start*coding until you__know__what you need to do.One thing I can tell you is that, in general, the more methods your class has, the better it will be. You've been given 4 tasks to complete, so think about writing 4 methods (at the very least) to do them.

And before you write one line of code for them: THINK.

Take your first task: "[Print out] the number or numbers that were picked least frequently."

What

__exactly__do you need to do to find out the "least frequent number or numbers"? A good tip is to write out a description as though you were describing it to a child who has no knowledge of Java.Also: if you want "number

**s**", how many do you want? The bottom 3...or 5...or 10? You need to be*precise*.And do that for all 4 tasks

*before you write a line of code*.HIH

Winston

PS: You might be interested in reading the WhereDoIStart page.

"Leadership is nature's way of removing morons from the productive flow" - Dogbert

Articles by Winston can be found here