# explaination and steps

Discussion in 'Java' started by ells912@gmail.com, Apr 16, 2008.

1. ### Guest

a. How to write a program that asks the user to enter any number of
integers that are in the range of 0 to 30 inclusive and count how many
occurrences of each number are entered. Use a suitable sentinel to
signal the end of input. Print out only the numbers (with the number
of occurrences) that were entered one or more times.

b. In a gymnastics or diving competition, each contestant's score is
calculated by dropping the lowest and highest scores and then adding
the remaining scores. Write a program that allows the user to enter
eight judges' scores and then outputs the point received by the
contestant. A judge awards point between 1 and 10, with 1 being the
lowest and 10 being the highest. For example, if the scores are:
9.2, 9.3, 9.0, 9.9, 9.5, 9.5, 9.6 and 9.8
the contestant receives a total of 56.9 points.

For both questions need to use array. Since i am not really good with
this topic, can somebody explain what is all about?? I am really
stuck !! thanks.

, Apr 16, 2008

2. ### Jeff HigginsGuest

ells912 wrote:
> a. How to write a program?
> b. Write a program!

<http://mindprod.com/jgloss/gettingstarted.html>

> For both questions need to use array.

<http://xahlee.org/java-a-day/arrays.html>

> Since i am not really good with
> this topic, can somebody explain what is all about?? I am really
> stuck !! thanks.

Jeff Higgins, Apr 16, 2008

3. ### RedGrittyBrickGuest

RedGrittyBrick, Apr 16, 2008
4. ### Jeff HigginsGuest

Jeff Higgins, Apr 16, 2008
5. ### Patricia ShanahanGuest

wrote:
> a. How to write a program that asks the user to enter any number of
> integers that are in the range of 0 to 30 inclusive and count how many
> occurrences of each number are entered. Use a suitable sentinel to
> signal the end of input. Print out only the numbers (with the number
> of occurrences) that were entered one or more times.
>
> b. In a gymnastics or diving competition, each contestant's score is
> calculated by dropping the lowest and highest scores and then adding
> the remaining scores. Write a program that allows the user to enter
> eight judges' scores and then outputs the point received by the
> contestant. A judge awards point between 1 and 10, with 1 being the
> lowest and 10 being the highest. For example, if the scores are:
> 9.2, 9.3, 9.0, 9.9, 9.5, 9.5, 9.6 and 9.8
> the contestant receives a total of 56.9 points.
>
> For both questions need to use array. Since i am not really good with
> this topic, can somebody explain what is all about?? I am really
> stuck !! thanks.

These exercises combine use of arrays with processing user input. If you
are not already comfortable with at least one of those topics you should
split the issues.

To improve your array skills, do each exercise with the input data

To learn user input, practice reading single numbers, then groups of
numbers, and e.g. printing the square of each input.

If there were earlier exercises for either of these topics, go back over
them and make sure you really understand them. Programming is a
cummulative subject - if you do not understand an earlier topic you will
have a lot of trouble learning later ones.

Patricia

Patricia Shanahan, Apr 16, 2008
6. ### Roedy GreenGuest

Roedy Green, Apr 16, 2008