daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void recordVehicleWeight()
  2.     {  
  3.         Scanner console = new Scanner (System.in);
  4.  
  5.         int searchResult;
  6.         String data;
  7.    
  8.         System.out.print("Enter booking ID: ");
  9.         data = console.nextLine();
  10.         searchResult = linearSearch(data);
  11.         if (searchResult != -1) // check if the booking ID found or not, -1 indicates not found
  12.         {  
  13.             if (searchResult != RVBooking)
  14.             System.out.println("Enter Vehicle Weight: ");
  15.             double weight = console.nextDouble();
  16.             if (bookings[searchResult].setVehicleWeight(weight))    // Set Vehicle weight
  17.                 System.out.println("Vehicle weight updated.");
  18.             else
  19.                 System.out.println("Invalid Weight.");
  20.  
  21.         } else
  22.             System.out.println("Error! Booking ID not found!");
  23.        
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top