期末作业(二)
import java.io.IOException;
import java.util.Scanner; public class FruitTest { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); Shopper shopper = new Shopper(); Manager manager = new Manager(); while(true){ System.out.println( " 欢迎光临水果系统"); System.out.println("请输入你的角色:(1.顾客 3.退出)"); int choice = sc.nextInt(); switch(choice){ case 1: shopper.shop(); break; case 2: System.exit(0); default: System.out.println("你的输入有误!"); } } } }

浙公网安备 33010602011771号