Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Ví dụ 2,8 nơi có một toán tử toán học và một nhà điều hành phân công những gì các lập trình viên đang cố gắng để đạt được chỉ định kết quả của tỷ lệ chia cho số ngày để năng suất biến Ví dụ 2.8: nhà điều hành ưu tiên tăng gấp đôi năng suất = tỷ lệ | Object Oriented Programming 33 if err throw new TradeException msg.ToString Example 3.16 shows how the TradeException is handled on the form with the exception being caught using the try and catch blocks. Example 3.16 User defined Exception TradeException being handled in a block of code try Trade tr new Trade tacct custacct qty price bs symbol ccy fx catch TradeException except MessageBox.Show except.Message finally Refresh the grids pHandler.reloadData all Clear the input box clearFields 3.1.3 Workshop Exercise one This workshop is the first in a series of workshops that are built on throughout the book. The idea is that by building on the workshops the end result is a relevant application an options calculator was chosen for its simplicity in terms of building an application. Each workshop takes the application a step further as well as giving you the chance to put into practice some of the concepts you have just learnt. The specification has been written and can be found in Appendix A in addition a diagrammatic representation of the options calculator can be seen in Appendix B. The actual models implemented in creating the workshops can be seen in Appendix C along with details of how to download the source files. 34 Applied C in Financial Markets The first part of the workshop is to create a new Windows application project. By default a Windows form is added to the project. Add the following components on the form. Text boxes and labels Strike price Stock Price Volatility Risk Free rate Result set to read-only and use it to display the price . DateTime Picker Expiry Date Radio buttons Put and call Black Scholes and Implicit Finite-Difference Button Calculate These form the input boxes required by the models to return a price. Further components will be added onto the form as the exercises progress through the book. Figure 3.1 Basic options calculation form Object Oriented Programming 35 Create a new class that will encapsulate these input fields called option.