"Write a program that first prompts the user to specify the number of integers to enter, then asks the user to enter integers, and finally displays the smallest integer entered"
Asking someone to input something is cake. What has me confused is this: When the user says they want to enter, say, 3 integers, how would I get the program to ask the user to enter those 3 integers.
My code so far looks like (using NetBeans 6.8):
import java.util.Scanner;
public class HW24 {
public static void main (String [] args) {
Scanner input = new Scanner(System.in);
// Prompt user to specify the number of integers to enter
System.out.print ("Enter number of integers to be entered: ");
final int integerEntry = input.nextInt();
// Enter integers (this is where I'm stuck)
Thanks for any help.
This post has been edited by pbl: 04 March 2010 - 09:02 PM
Reason for edit:: Code tags added for a newbie

New Topic/Question
Reply
MultiQuote












|