tailieunhanh - Lecture Object Oriented Programing - Chapter 5: Control statements (cont)

After studying this chapter you will be able to understand: The essentials of counter-controlled repetition, to use the for and do while repetition statements to execute statements in a program repeatedly, to understand multiple selection using the switch selection statement, to use the break and continue program control statements to alter the flow of control, to use the logical operators to form complex conditional expressions in control statements. | 5 Control Statements: Part 2 Not everything that can be counted counts, and not every thing that counts can be counted. Albert Einstein Who can control his fate? William Shakespeare The used key is always bright. Benjamin Franklin Intelligence is the faculty of making artificial objects, especially tools to make tools. Henri Bergson Every advantage in the past is judged in the light of the final issue. Demosthenes OBJECTIVES In this chapter you will learn: The essentials of counter-controlled repetition. To use the for and do while repetition statements to execute statements in a program repeatedly. To understand multiple selection using the switch selection statement. To use the break and continue program control statements to alter the flow of control. To use the logical operators to form complex conditional expressions in control statements. Introduction Essentials of Counter-Controlled Repetition for Repetition Statement Examples Using the for | 5 Control Statements: Part 2 Not everything that can be counted counts, and not every thing that counts can be counted. Albert Einstein Who can control his fate? William Shakespeare The used key is always bright. Benjamin Franklin Intelligence is the faculty of making artificial objects, especially tools to make tools. Henri Bergson Every advantage in the past is judged in the light of the final issue. Demosthenes OBJECTIVES In this chapter you will learn: The essentials of counter-controlled repetition. To use the for and do while repetition statements to execute statements in a program repeatedly. To understand multiple selection using the switch selection statement. To use the break and continue program control statements to alter the flow of control. To use the logical operators to form complex conditional expressions in control statements. Introduction Essentials of Counter-Controlled Repetition for Repetition Statement Examples Using the for Statement do while Repetition Statement switch Multiple-Selection Statement break and continue Statements Logical Operators Structured Programming Summary (Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals (Optional) Software Engineering Case Study: Identifying Objects’ States and Activities Wrap-Up Introduction Continue structured-programming discussion Introduce Java’s remaining control structures for, do while, switch Essentials of Counter-Controlled Repetition Counter-controlled repetition requires: Control variable (loop counter) Initial value of the control variable Increment/decrement of control variable through each loop Loop-continuation condition that tests for the final value of the control variable Outline Control-variable name is counter Control-variable initial value is 1 Condition tests for counter’s final value Increment for counter Common Programming Error .

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.