I'm trying to create a new object using a user input. I tried assigning the user input to variables but don't know how to add the variables to the new object in the when I declare the new object. This is just the part of my code that i need help with. part i need help with is line 8. i know i can just put something random and when i use my set methods it will overwrite but that's not what I want. thank you in advance
Scanner input = new Scanner(System.in);
System.out.println("Enter the name of the Soda: ");
String soda = input.nextLine();
System.out.println("Inventory count?: ");
int product = input.nextInt();
System.out.println("Cost of Soda?: ");
double cost = input.nextDouble();
SodaMachine one = new SodaMachine(String soda, int product, double cost);
one.setCostOfBottle(cost);
one.setInventory(product);
one.setNameOfSoda(soda);