TAILIEUCHUNG - Lecter Java: Program design - Chapter 6: Iteration

In this chapter, we consider the while, for, and do-while looping constructs that control how many times a statement list is iterated (executed). Loops make programs much more powerful and capable of solving significant problems. Mastering the design and implementation of loops is an important part of a programmer's education. | Iteration Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Java looping Options while do-while for Allow programs to control how many times a statement list is executed Averaging Problem Extract a list of positive numbers from standard input and produce their average Numbers are one per line A negative number acts as a sentinel to indicate that there are no more numbers to process Observations Cannot supply sufficient code using just assignments and conditional constructs to solve the problem Don’t how big of a list to process Need ability to repeat code as needed Averaging Problem Extract a list of positive numbers from standard input and produce their average Numbers are one per line A negative number acts as a sentinel to indicate that there are no more numbers to process Algorithm Prepare for processing Get first input While there is an input to process do { Process current input Get the next input } Perform final processing Averaging .

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.