Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void recordVehicleWeight()
- {
- Scanner console = new Scanner (System.in);
- int searchResult;
- String data;
- System.out.print("Enter booking ID: ");
- data = console.nextLine();
- searchResult = linearSearch(data);
- if (searchResult != -1) // check if the booking ID found or not, -1 indicates not found
- {
- if (searchResult != RVBooking)
- System.out.println("Enter Vehicle Weight: ");
- double weight = console.nextDouble();
- if (bookings[searchResult].setVehicleWeight(weight)) // Set Vehicle weight
- System.out.println("Vehicle weight updated.");
- else
- System.out.println("Invalid Weight.");
- } else
- System.out.println("Error! Booking ID not found!");
- }
Add Comment
Please, Sign In to add comment