集册 Java实例教程 掉入开关盒

掉入开关盒

欢马劈雪     最近更新时间:2020-01-02 10:19:05

524
掉入开关盒
/*
来 自*
 时 代 J a v a 公 众 号
*/

import java.util.Scanner;


public class CarWashApp

{

  static Scanner sc = new Scanner(System.in);


  public static void main(String[] args)

  {

    System.out.println

      ("The car wash application!\n\n");

    System.out.print("Enter the package code: ");

    String s = sc.next();

    char p = s.charAt(0);


    String details = "";

    /* 
     来自 
    *n o w j a v a . c o m*/

    switch (p)

    {

      case 'E':

      case 'e':

        details += "E or e\n";

      case 'D':

      case 'd':

        details += "D or d\n";

      case 'C':

      case 'c':

      details += "C or c\n";

      case 'B':

      case 'b':

        details += "B or b\n";

      case 'A':

      case 
展开阅读全文