TAILIEUCHUNG - murachs Java SE 2010 phần 3

Thay vào đó, tác giả Anne Boehm đã cẩn thận phân tích những thay đổi ảnh hưởng đến cách bạn phát triển các ứng dụng web và những gì bạn cần phải học khi. Điều đó có nghĩa là cuốn sách này tích hợp các vật liệu mới với tính năng cổ điển đã không thay đổi, | Chapter 4 How to code control statements 149 The code import import public class FutureValueApp public static void main String args _ _ _ Scanner sc new Scanner String choice y while 1 n get the input from the user Enter monthly Investment double monthlylnvestment Enter yearly interest rate double InterestRate Enter number of years int years convert yearly values to monthly values double monthlylnterestRate interestRate 12 100 int months years 12 call the future value method double futurevalue calculateFutureValue monthlylnvestment monthlylnterestRate months format and display the result NumberFormat currency Future value futurevalue see If the user wants to continue Continue y n choice . a static method that requires three arguments and returns a double private static double calculateFutureValue double monthlylnvestment double monthlylnterestRate Int months _ double futurevalue for Int 1 1 1 months i _ futurevalue futurevalue monthlylnvestment 1 monthlylnterestRate _ return futurevalue Figure 4-14 The Future Value application with a static method Download from Wow eBook 150 Section 1 Essential Java skills Perspective If this chapter has succeeded you should now be able to use if switch while do-while and for statements. These are the Java statements that implement the selection case and iteration structures and they provide the logic of an application. You should also be able to code and call your own static methods which will help you divide your programs into manageable parts. Summary You can use the relational operators to create Boolean expressions that compare primitive data types and return true or false values and you can use the logical .

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.