pleas help
public double getInvoiceAmuont(int q,double pric){
System.out.println("ente the quantity and the peice" );
q=in.nextInt();
pric=in.nextDouble();
if (q<0)
return 0;
if (pric<0)
return 0;
return q*pric;
}
is this answer correct for this question :
{{ -Provide a method named getInvoiceAmuont that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0.0. }}