Initializing inventory count and item price variables

Report a typo

The logic of your bookstore’s inventory management is given in the provided Java code. However, the code will not compile due to some unidentified variables. Your task is to fill the blanks in the code to successfully declare and initialize the inventory count (an integer), and the price of each item (an integer).

Fill in the gaps with the relevant elements
  Main { 
  public static void main(String[] args) {
     itemCount = 5;
    String itemName = "book";
     itemPrice = 24.99;
    System.out.println("I have " + itemCount + " " + itemName + "s and each costs $" + itemPrice);
  }
}

Create a free account to access the full topic