TAILIEUCHUNG - Java Concepts 5th Edition and 6th phần 8

Trong khi làm việc trên các động cơ khác biệt, Babbage hình thành của một tầm nhìn nhiều grander mà ông gọi là Công cụ phân tích. Các động cơ khác biệt được thiết kế để thực hiện một thiết lập giới hạn của tính toán là không thông minh hơn một máy tính bỏ túi ngày nay. | Java Concepts 5th Edition 99 100 assert state TRANSACT 101 return 102 103 104 105 Moves back to the previous state. 106 107 public void back 108 109 if state TRANSACT 110 state ACCOUNT 111 else if state ACCOUNT 112 state PIN 113 else if state PIN 114 state START 115 116 117 118 Gets the current state of this ATM. 119 @return the current state 120 121 public int getState 122 566 567 123 return state 124 125 126 private int state 127 private int customerNumber 128 private Customer currentCustomer 129 private BankAccount currentAccount 130 private Bank theBank 131 132 public static final int START 1 133 public static final int PIN 2 134 public static final int ACCOUNT 3 135 public static final int TRANSACT 4 136 137 public static final int CHECKING 1 138 public static final int SAVINGS 2 139 Chapter 12 Object-Oriented Design Page 51 of 77 Java Concepts 5th Edition ch12 atm 1 import 2 import 3 import 4 import 5 6 7 A bank contains customers with bank accounts. 8 9 public class Bank 10 11 12 Constructs a bank with no customers. 13 14 public Bank 15 16 customers new ArrayList Customer 17 18 19 20 Reads the customer numbers and pins 21 and initializes the bank accounts. 22 @param filename the name of the customer file 23 24 public void readCustomers String filename 25 throws IOException 26 27 Scanner in new Scanner new FileReader filename 28 while 29 30 int number 31 int pin 32 Customer c new Customer number pin 33 addCustomer c 567 34 35 36 37 568 Chapter 12 Object-Oriented Design Page 52 of 77 Java Concepts 5th Edition 38 39 Adds a customer to the bank. 40 @param c the customer to add 41 42 public void addCustomer Customer c 43 44 c 45 46 47 48 Finds a customer in the bank. 49 @param aNumber a customer number 50 @param aPin a personal identification number 51 @return the matching customer or null if no .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.