1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture An introduction to computer science using java (2nd Edition): Chapter 6 - S.N. Kamin, D. Mickunas, E. Reingold

20 58 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Chapter 6 Iteration

  • Chapter Preview

  • while Loop

  • while Loop From Temperature Conversion Program

  • PowerPoint Presentation

  • for Statement

  • Comparing for and while

  • Temperature Conversion Program Loop Implemented Using for

  • do-while Statement

  • Comparing do-while and while

  • Slide 11

  • Reading Input Using a Loop

  • Sentinel Controlled Loop

  • Reading to End of Input

  • Loop-and-a-Half

  • Slide 16

  • Infinite Loop with Escape

  • Slide 18

  • Drawing in Java

  • Nested Loops

Nội dung

Chapter 6 - Iteration. In this chapter we will: discuss the use of repetition (iteration) in programming algorithms; describe the Java while, for, and do-while statements; demonstrate the use of loop invariants to verify the correctness of loops; show the use of loops in data entry and computer animation.

Chapter Iteration Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N Kamin, D Mickunas, E Reingold     Chapter Preview In this chapter we will: • discuss the use of repetition (iteration) in programming algorithms • describe the Java while, for, and do-while statements • demonstrate the use of loop invariants to verify the correctness of loops • show the use of loops in data entry and computer animation     while Loop • Repeated executes body of the loop which can be a single or compound statement • A while loop will execute as long as its condition is true • An infinite loop will occur if the condition never becomes false • Example:   count = 1; while (count

Ngày đăng: 11/01/2020, 18:43

TỪ KHÓA LIÊN QUAN