Write a program that does the following:
a) creates an array of user specified length of random integers between 0 and 100.
b) allow user to print array in ascending or descending order.
c) allow user to search for specific int value (you can use your code from part 2)
d) allow user to view max value, min value, average and standard deviation of the array values.
e) user controls must be provided and can be as a command line prompt and response.

The professor won't post the answer OR get back to me. I have made it through only part a. Could someone please help? Everything builds off of this. Thanks!

Recommended Answers

All 4 Replies

I have made it through only part a.

Then please post the code to prove you've done it. Our rules clearly state that we require proof of effort on homework.

b) allow user to print array in ascending or descending order.

I imagine either you've learned about bubble sort, or you're allowed to use Array.sort().

c) allow user to search for specific int value (you can use your code from part 2)

Presumably you've already done part 2, so what's the problem?

d) allow user to view max value, min value, average and standard deviation of the array values.

Can you do this manually? If you can't do something on paper with a handful of numbers then you have no hope of telling a computer how to do it.

e) user controls must be provided and can be as a command line prompt and response.

That's a fancy way of saying that you need a user menu for selecting which action to take and for acquiring the initial array size. But since you've accomplished part a, you shouldn't have any problems with this part either.

worst advice ever.

what I've seen in a first glimpse:
* advising to use awt instead of Swing,
* having your main method throwing exceptions,
* providing no comments or other form of explanation of what's going on what-so-ever,
* extending thread instead of using the Runnable interface,
* personally never been pro-usage of 'for(;;)',
* ....

I just assume you are a moderator or author on that page, and want some advertisement done, but my advice: first make sure the contents is as good as you make it sound to be.

especially for someone who's just starting with Java, a site like this is about the last I would recommend.

Yes.
@niravn: the code on that site is a terrible example of how to code Java in 2012.
Post deleted.

Remember ou are required to comply with DaniWeb member rules, including
"Do ensure that all posts contain relevant content and substance and are not simply vehicles for external links". Any repetition will result in an infraction.

@Deceptikon: just to be clear, my post above was a reply to niravn 's (now deleted) post, not to yours :)

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.