import java.util.Scanner;
public class ISP
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
String ISPP;
int hours;
double runup, total;
System.out.println("Please enter which package you have.");
ISPP = input.nextLine();
if(ISPP == "A")
{
System.out.println("Please enter the number of hours you have used the
interwebs.");
hours = input.nextInt();
if(hours > 10)
{
runup = (hours - 10) * 2;
total = runup + 9.95;
System.out.println("The total charge is $" + total);
}
}
}
}
因此,当它运行时,用户输入 AB 或 C,如果我尝试输入 to 以测试它并输入 A,则操作结束并且没有任何反应,尚未编写 B 或 C