I was just writing code for project that's due for class but I'm having a problem because I need to multiply my string with a number. Here's parts of my code
int shoes=50;
int shirts=30;
int shorts=75;
int caps=15;
int jackets=100;
Those above are the products and how much they cost in dollars:
System.out.print("Enter the product: ");
String product=keyboard.nextLine();
System.out.print("Enter the quantity of the product");
int quantity=keyboard.nextInt();
System.out.print("cost= +product+*+quantity+");
int cost= product*quantity;
This is the error I'm having: The operator * is undefined for the argument type(s) string, int
Any suggestions?