Advertisement
JeffGrigg

Untitled

Dec 21st, 2023
2,236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.36 KB | Source Code | 0 0
  1. public void onBarcode(final String barcode) {
  2.     if (barcode.isEmpty()) {
  3.         display.displayEmptyBarcodeMessage();
  4.     } else {
  5.  
  6.         final Price price = catalog.findPrice(barcode);
  7.  
  8.         if (price == null) {
  9.             display.displayProductNotFoundMessage(barcode);
  10.         } else {
  11.             display.displayPrice(price);
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement