I'm writing code for an assignment but missed out on some of the classes. I tried to follow the videos but keep getting an error saying "No enclosing instance of type chuckALuck is accessible". The error is on the line where I try to create a WalletObject. Can someone help please? I want to let the user specify how much money he has.




package chuckALuck;
import java.util.Scanner;

public class chuckALuck {


public static void main(String[] args) {
// TODO Auto-generated method stub

System.out.println("How much Money do you have?");
Scanner input = new Scanner(System.in);
double money = input.nextDouble();
System.out.println("How many sides would you like the dice to have?");
int sides = input.nextInt();

Wallet WalletObject = new Wallet();
WalletObject.put(money);

System.out.println("How much would you like to bet in euros?");
int currentBet = input.nextInt(); 
input.close();
}

public class Wallet { // Wallet data type 
  // current cash in wallet 
  private double cash;  // invariant: cash >= 0.0 

  // construct wallet with zero cash 
  public Wallet() { cash = 0.0; } 
   
  // put an amount of money into wallet 
  // pre-condition: money > 0.0 
  public void put(double  money) { 
     assert money > 0.0 : "Wallet put method: pre-condition violated!"; 
     if (money > 0.0) cash = cash + money; 
  } 
   
  // get an amount of money from wallet 
  // returns true if wallet had enough cash, false otherwise 
  // pre-condition: money > 0.0 
  public boolean get(double money){ 
     assert money > 0.0 : "Wallet get method: pre-condition violated!"; 
     if (money > 0.0 && cash >= money) { 
        cash = cash - money; 
        return true; 
     } 
     return false; 
  } 
   
  // return current amount of cash in wallet 
  public double check() { return cash; } 
   
  // convert to a String data type value 
  public String toString() { 
     return getClass().getName() + "[cash = " + cash + "]"; 
  } 
   
} // end Wallet data type 


public class Dice { // Dice data type  
  // number of sides on dice 
  private final int sides; // invariant: sides > 1 
   
  // current number on top face of dice 
  private int topFace; // invariant: 1 1 : "Dice constructor: pre-condition violated!"; 
     sides = n > 1 ? n : 2; // ensure at least 2 sides 
     topFace = (int)(Math.random() * sides) + 1;  
  } 
 
  // construct a dice with 6 sides 
  public Dice(){ 
     this(6); // invoke Dice constructor with value 6 
  } 
 
  // return current value of top face of dice  
  public int topFace(){ return topFace; } 
   
   // roll the dice; returning the result  
  public int roll() { 
     topFace = (int)(Math.random() * sides) + 1; 
     return topFace; 
  }    
   
  // convert to a String data type value 
  public String toString() { 
     return getClass().getName()  
       + "[sides = " + sides + ", topFace = " + topFace + "]";  
  } 
 
} // end Dice data type 
}