explaination and steps

E

ells912

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.
 
P

Patricia Shanahan

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
already in an array.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top