Question: Hello! I am working on a final project for a Java Object Oriented programming class (using Netbeans on Macbook) that is a DMV database with
Hello! I am working on a final project for a Java Object Oriented programming class (using Netbeans on Macbook) that is a DMV database with two classes: Vehicle and DMV, with an array of 100 vehicles. I got the code put together with no errors, and it runs at first, with entries accepted, however, when I attempt to input a second vehicle with liscense plate, owner name and phone number I get the following error:
Exception in thread "main" java.util.InputMismatchException: For input string: "4143536676" at java.util.Scanner.nextInt(Scanner.java:2123) at java.util.Scanner.nextInt(Scanner.java:2076) at schmidtcfinalproj.DMVAppFinal.main(DMVAppFinal.java:40) /Users/crystalrschmidt/Library/Caches/NetBeans/8.2/executor-snippets/run.xml:53: Java returned: 1 BUILD FAILED (total time: 55 seconds)
I noticed that it will not let me put in more than a single name (so no first name, last name), and it is only written to accept numbers for plate numberm=, not a combination of number and letters. For this project purposes, that's ok. I wonder, though, if I need some extra code for 9 digit, real world phone numbers?
Any insight provided would be awesome!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
