Java Beginner

Hi everyone, im new to this and am looking for some help. Im doing a java course in college. Its only a basic intro to java but its quite difficult. im on a question that requires me to use loops.....

Find the smallest number in a list of 10 integers.

i think i have to ask for an input of 10 numbers then output which is the smallest

any help is greatly appreciated.

Andy

[403 byte] By [andyneouka] at [2007-11-26 22:36:38]
# 1

Here's a breakdown to get you started, post your code when you get stuck:

1. Read each of the ten numbers from input.

2. Store each number in an array

3. After all numbers are input, set the minimum to the first number.

4. loop over the array, if the current number is lower than the minimum, set the minimum to the current number.

5. Print out the minimum.

hunter9000a at 2007-7-10 11:47:00 > top of Java-index,Other Topics,Algorithms...
# 2
Thanks for the reply, unfortunately i cant use arrays, its part of the criteria for the question. will have another shot at it tomorrowAndy
andyneouka at 2007-7-10 11:47:00 > top of Java-index,Other Topics,Algorithms...
# 3

> Hi everyone, im new to this and am looking for some

> help. Im doing a java course in college. Its only a

> basic intro to java but its quite difficult. im on a

> question that requires me to use loops.....

>

> Find the smallest number in a list of 10 integers.

You said you can't use arrays, but yet you're talking about a list (a sort of array).

> i think i have to ask for an input of 10 numbers then

> output which is the smallest

>

> any help is greatly appreciated.

>

> Andy

I'm afraid you can only be helped if you know the exact requirement of your assignment.

When you do, please post your question in the New To Java section of this forum, since this has little to do with algrithms:

http://forum.java.sun.com/forum.jspa?forumID=54

When posting your question there, be sure to include a specific Java related question about the code that is giving you trouble. When posting code, please take the time to read these (short) instructions:

http://forum.java.sun.com/help.jspa?sec=formatting

Good luck.

prometheuzza at 2007-7-10 11:47:00 > top of Java-index,Other Topics,Algorithms...