所以我的任务是创建一个prog(必须有2个方法),这将要求用户输入一个顶部和他/她想要的披萨的直径,但事情是我不断得到3个错误,所以我真的不知道该怎么做这里是我的编程
import java.util.Scanner;
public class SorianoExer11 {
public static void main(String[] args) {
System.out.print("Please enter the desired pizza: "+ Pizza(topping,diameter ,price));
}
public static String Pizza( String topping , int diameter , double price) {
Scanner sc = new Scanner (System.in);
price = 100.00;
System.out.print("Enter the pizza topping: ");
topping = sc.nextLine();
System.out.print("Please enter the diameter of the pizza: ");
diameter = Integer.parseInt(sc.nextLine());
System.out.print("The price is: "+ price);
}
}
所以错误发生在第5行,错误是找不到3个符号所以我希望你能帮忙谢谢