Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Assignment33
- {
- public static void main (String[] args)
- {
- Scanner input = new Scanner (System.in);
- int productCounter1 = 0;
- System.out.print("Enter product numbers in the range 1-5, then enter the value -1 to terminate: ");
- int products = input.nextInt();
- while ( input.nextInt() != -1)
- {
- switch (products)
- {
- case 1:
- ++productCounter1;
- break;
- }
- }
- System.out.print("Product 1: " + productCounter1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement