⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkbookmain.java

📁 Java程序设计技巧与开发实例附书源代码。
💻 JAVA
字号:

public class CheckBookMain
{
   private static CheckBook checkBook = null;
   public static String showMenu()
   {
      System.out.println("\n\t\t to add a [C]heck");
      System.out.println("\t\t to add a [D]eposit");
      System.out.println("\t\t to [L]ist all transactions");
      System.out.println("\n\t\t to e[X]it program");
      System.out.print("\n\tYour choice: ");
      return Console.readString();
   }

   public static void main(String args[])
   {
      System.out.print("Starting balance: $");
      checkBook = new CheckBook(Console.readDouble());
      String choice = showMenu();
      while (!choice.equalsIgnoreCase("X"))
      {
         if (choice.equalsIgnoreCase("C"))
         {
            checkBook.add(new Check());
         }
         else if (choice.equalsIgnoreCase("D"))
         {
            checkBook.add(new Deposit());
         }
         else if (choice.equalsIgnoreCase("L"))
         {
            checkBook.list();
         }
         choice = showMenu();
      }
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -