tailieunhanh - Microsoft Visual C# 2010 Step by Step (P3)

Tham khảo sách 'microsoft visual c# 2010 step by step (p3)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 70 Part I Introducing Microsoft Visual C and Microsoft Visual Studio 2010 12. In the run method modify the statement that calls calculateFee and specify the dailyRate parameter by name public void run double fee calculateFee dailyRate Fee is 0 fee 13. On the Debug menu click Start Without Debugging to build and run the program. The program displays the following messages calculateFee using one optional parameter Fee is 375 As earlier the run method called the version of calculateFee that takes one optional parameter. Changing the code to use a named argument does not change the way in which the compiler resolves the method call in this example. Press any key to close the console window and return to Visual Studio. 14. In the run method modify the statement that calls calculateFee and specify the noOfDays parameter by name public void run double fee calculateFee noOfDays 4 Fee is 0 fee 15. On the Debug menu click Start Without Debugging to build and run the program. The program displays the following messages calculateFee using two optional parameters Fee is 2000 This time the run method called the version of calculateFee that takes two optional parameters. The method call has omitted the first parameter dailyRate and specified the second parameter by name. This is the only version of the calculateFee method that matches the call. Press any key to close the console window and return to Visual Studio. 16. Modify the implementation of the calculateFee method that takes two optional parameters. Change the name of the first parameter to theDailyRate and update the return statement as shown in bold type in the following code private double calculateFee double theDailyRate int noOfDays 5 calculateFee using two optional parameters return theDailyRate noOfDays Chapter 3 Writing Methods and Applying Scope 71 17. In the run method modify the statement that calls calculateFee and specify the theDailyRate .

TÀI LIỆU LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã 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.