Advertisement
Guest User

ES Portal

a guest
Oct 21st, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import java.util.*;
  2. public class EsPortal {
  3.  
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6. String items;
  7. double itemsPrice = 0;
  8. int itemsStock = 50;
  9. System.out.println("ES Companies Portal – Cashier App 3");
  10. System.out.println("===================================");
  11.  
  12. do {
  13. System.out.println("Input item's name [5..30 character]");
  14. items = scan.nextLine();
  15. } while(!(items.length() >= 5 && items.length()<=30));
  16.  
  17. do {
  18. System.out.println("Input item's price [use decimal number 20...2000]");
  19.  
  20. try{
  21. itemsPrice = scan.nextDouble();
  22. }catch (Exception e) {}
  23.  
  24. }while(!(itemsPrice >=20 && itemsPrice <=2000));
  25.  
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement