import javax.swing.*;
import java.util.Scanner;
public class Product {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
long inputnum = 0;
String s = "";
while (!s.equalsIgnoreCase("###")) {
System.out.println("Enter name of hardware device");
if (!(s = scanner.nextLine()).equalsIgnoreCase("###")) {
System.out.println("Hardware device: " + s);
inputnum++;
}
}
JOptionPane.showMessageDialog(null, "Number of entered names: " + inputnum);
}
}
Comments
Leave a comment