A
ajaywadhwani
Hi
I am a newbie to the NetBeans and have recently downloaded the NetBeans
5.5.
However, I am facing one problem.
For example: for calculating the lowest of a given set of numbers,
please go thru the code below
/**
*EXERCISE 5.11: WRITE AN APPLICATION THAT FINDS THE SMALLEST OF
SEVERAL
* INTEGERS. ASSUME THAT THE FIRST VALUE READ SPECIFIES
* THE NUMBER OF VALUES TO INPUT FROM THE USER.
* @author ajay
*/
import java.util.Scanner;
public class lowest {
public static void main(String[] args) {
int number;
int lowest = 1000;
int count;
Scanner input = new Scanner (System.in);
System.out.print("Enter the number of entries: ");
count = input.nextInt();
for (int i = 1; i <= count; i++) {
System.out.print("Enter the number: ");
number = input.nextInt();
if(number < lowest)
lowest = number;
}
System.out.printf("Lowest number among %d entries: %d", count,
lowest);
}
}
Building the project is fine... but when I run this program, it just
displays these lines...
init:
deps-jar:
compile:
run:
There is no display asking for the number of entries.
In which ever case where the input from the computer has to be given
first, it just shows this message and displays a "Building Message" at
the bottom
WHAT SHALL BE DONE???
I am a newbie to the NetBeans and have recently downloaded the NetBeans
5.5.
However, I am facing one problem.
For example: for calculating the lowest of a given set of numbers,
please go thru the code below
/**
*EXERCISE 5.11: WRITE AN APPLICATION THAT FINDS THE SMALLEST OF
SEVERAL
* INTEGERS. ASSUME THAT THE FIRST VALUE READ SPECIFIES
* THE NUMBER OF VALUES TO INPUT FROM THE USER.
* @author ajay
*/
import java.util.Scanner;
public class lowest {
public static void main(String[] args) {
int number;
int lowest = 1000;
int count;
Scanner input = new Scanner (System.in);
System.out.print("Enter the number of entries: ");
count = input.nextInt();
for (int i = 1; i <= count; i++) {
System.out.print("Enter the number: ");
number = input.nextInt();
if(number < lowest)
lowest = number;
}
System.out.printf("Lowest number among %d entries: %d", count,
lowest);
}
}
Building the project is fine... but when I run this program, it just
displays these lines...
init:
deps-jar:
compile:
run:
There is no display asking for the number of entries.
In which ever case where the input from the computer has to be given
first, it just shows this message and displays a "Building Message" at
the bottom
WHAT SHALL BE DONE???