ATM project

Hello everyone and this is my very first post!

Ive made a new personal project trying out my knowledge n java,but i’m getting an error witch i can not figure it out, and i could apreciate i little bit of help!
I have 3 classes and one main everything works fine until you choose withdraw you put every ammount and i get an exception … i haven’t already done nothing on deposit i only trying to fix withdraw for now!

import java.util.Scanner;

public class AtmController {

    public static void main(String[] args) {
        Scanner input = new Scanner(;
        String id;
        String password;

        id =;
        password =;

        if(id.equals("Kevin") && password.equals("atmGeorge")) {
            System.out.println("Welcome Kevin to your account !");
        else {
            System.out.println("invalid user registration !");



this is the first

import java.util.Scanner;

public class PrintMenus {

    public static void printMenu1() {
        System.out.println("-----------------Welcome to BANK -- NBC ----------------------");
        System.out.println("Welcome to our Bank ");
        System.out.println("Please enter your id : ");
    public static void printMenu2(){
        System.out.println("Please enter your password : ");


    public static void doTransaction(){
        int choice = 0;
        System.out.println("-----------------Please enter your Transaction ----------------------");
        System.out.println("1. Withdraw : ");
        System.out.println("2. Deposit : ");

    public static double readChoice() {
        Scanner scanner = new Scanner(;
        return scanner.nextDouble();

this is the second

import java.util.Scanner;

public class TransactionMenu {
    public static double balance;

    public static void doWithdraw(){
        double withdraw;
        double accountBalance;
        double userBalance;
        accountBalance = balance;
        Scanner inputAmmount = new Scanner(;
        withdraw = inputAmmount.nextDouble();
        double ammountToWithdraw = PrintMenus.readChoice();
        userBalance = (accountBalance - ammountToWithdraw);
        System.out.println("Your new Balance is : " + userBalance);

    public void setBalance(double balance) {
        this.balance = 0.0;
    public static void TransactionMenu(int choice) {
        Scanner userChoice = new Scanner(;
        choice = userChoice.nextInt();
        switch (choice) {
            case 1:
                System.out.println("Enter your ammount of choice : ");
            case 2:
                System.out.println("Wrong choice");



and this is the third thank u in advance for every suggestion and fixes!!!

What’s the error message? And if you’re giving it input, then what input is that? You could for example provide input that can be pasted in to get the same thing.

Enter your ammount of choice :
Exception in thread “main” java.util.InputMismatchException
at java.base/java.util.Scanner.throwFor(
at java.base/
at java.base/java.util.Scanner.nextDouble(
at TransactionMenu.doWithdraw(
at TransactionMenu.TransactionMenu(
at PrintMenus.doTransaction(
at AtmController.main(

Process finished with exit code 1

that is the error code message and i’m selecting withdraw with double ammount and it gets this out

maybe that’s not how your locale says a float looks like. maybe it wants a comma.