采纳哦
String productName;
int priceAfterTax;
int priceBeforeTax;
double taxRate = 0;
Scanner sc = new Scanner(System.in);
System.out.println("请输入商品名称:");
productName = sc.nextLine();
System.out.println("请输入税前价格:");
priceBeforeTax = sc.nextInt();
System.out.println("请输入税率:");
taxRate = sc.nextDouble();