in this assignment
make the program read 10 integers and store them in an array. Then,
pass this array to a method that finds the largest integer in the array, and
counts its occurrences. Your method should return a string of the form
largestNumber
Hussam Alahmadi
-3
Light Poster
Recommended Answers
Jump to Postwhat have you got so far? I hope you've gotten just a bit further than just the assignment?
Jump to Postif you don't understand your assignment, you should ask your teacher for more information.
but, since it's a very easy assignment, if I were you, I would try to write it, if only step by step.
so:
step1 - write the code to read 10 integers and store …
Jump to Postfirst write the code for the first two steps, and post it here, then I might help you get to the third.
Jump to PostYou will need to compare the values in the array, storing the higest in a temp value.
After that then you will need to search the array for that value and increment a counter every time you find that value.
Jump to Postthe way you were going was good.
he BeginnerDev means something like this:int nr, count, highest; read count; perform count times{ read nr; if ( nr higher than highest ){ highest = nr; } add nr to array; }
now you'll have about the same as …
All 28 Replies
stultuske
1,116
Posting Maven
Featured Poster
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
Hussam Alahmadi
-3
Light Poster
Hussam Alahmadi
-3
Light Poster
Begginnerdev
256
Junior Poster
Begginnerdev
256
Junior Poster
Hussam Alahmadi
-3
Light Poster
Begginnerdev
256
Junior Poster
stultuske
1,116
Posting Maven
Featured Poster
Begginnerdev
256
Junior Poster
Hussam Alahmadi
-3
Light Poster
rotten69
20
Posting Whiz
Hussam Alahmadi
-3
Light Poster
Begginnerdev
256
Junior Poster
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
zeroliken
79
Nearly a Posting Virtuoso
Hussam Alahmadi
-3
Light Poster
zeroliken
79
Nearly a Posting Virtuoso
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
Hussam Alahmadi
-3
Light Poster
stultuske
1,116
Posting Maven
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.