• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Find the highest and lowest value in an array

 
jade sayson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you help me,about multidimentional arrays that can write a program that determines the highest and the lowest of the 12 input values?..

there are 12 numbers to enter:
13 15 20 13 35 40 16 18 20 18 20 14

the is output is:

enter twelve numbers

highest:_____
lowest:_____


thanks again;
 
Nikhil Sagar
Ranch Hand
Posts: 216
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jade, and welcome to the Ranch.
First of all you need to understand some rules of posting on this site.
Don't worry they are just like the general rules to post on any forum around the web. So, it is my request to read them carefully.
HowToAnswerOnJavaRanch and HowToAskQuestionsOnJavaRanch
 
Nikhil Sagar
Ranch Hand
Posts: 216
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jade sayson wrote:can you help me,about multidimentional arrays that can write a program that determines the highest and the lowest of the 12 input values?..

there are 12 numbers to enter:
13 15 20 13 35 40 16 18 20 18 20 14

the is output is:

enter twelve numbers

highest:_____
lowest:_____


thanks again;


Here we want to help you dear, but you are asking us not to help you but to do your home work.
It looks like a home work if not then its better if you ShowSomeEfforts
 
Enkita mody
Ranch Hand
Posts: 333
Firefox Browser Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can't write that program for you.You have to do yourself, but if you find any doubt in it surely ranchers will help you.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome (again)

Beware of saying multidimensional array, because Java doesn’t have them. It has arrays of arrays instead, which are better.

You should be doing largest and smallest on a 1‑dimensional array anyway. It is quite simple. You need to write it down with pencil paper and eraser (the latter being the most important), and you will then find it easy to convert to real code.
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jade, and welcome to JavaRanch!
It would be really helpful if you could give us an idea of what you've tried so far and where you're stuck.
My advice for now would be to forget about the input business.
Just write a program that uses a hard-coded set of numbers and write the logic to determine the highest and lowest value.
You could tie that logic to dynamic input at a later stage.

Edit: Ugh, too slow (again)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic