After you have read and studied this chapter, you should be able to: Implement repetition control in a program by using while statements, implement repetition control in a program by using do-while statements, implement a generic loop-and-a-half repetition control statement, implement repetition control in a program by using for statements,. | Chapter 6 Repetition Statements Chapter 6 Objectives After you have read and studied this chapter, you should be able to Implement repetition control in a program by using while statements. Implement repetition control in a program by using do-while statements. Implement a generic loop-and-a-half repetition control statement. Implement repetition control in a program by using for statements. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 6 Objectives, cont. After you have read and studied this chapter, you should be able to Nest a loop repetition statement inside another repetition statement. Choose the appropriate repetition control statement for a given task. Prompt the user for a yes/no reply by using the showConfirmDialog method from the JOptionPane class. (Optional) Write simple recursive methods. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. The while Statement Repetition statements control a block of code to be executed for a fixed number of times or until a certain condition is met. Java has three repetition statements: while do-while for ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. The while Statement In Java, while statements follow a general format: while ( ) For example: int sum = 0, number = 1; while (number is known as the loop body. As long as the is true, the loop body is executed. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Fig. Correspondence of the example while statement to the general format. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Fig. A diagram showing the . | Chapter 6 Repetition Statements Chapter 6 Objectives After you have read and studied this chapter, you should be able to Implement repetition control in a program by using while statements. Implement repetition control in a program by using do-while statements. Implement a generic loop-and-a-half repetition control statement. Implement repetition control in a program by using for statements. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 6 Objectives, cont. After you have read and studied this chapter, you should be able to Nest a loop repetition statement inside another repetition statement. Choose the appropriate repetition control statement for a given task. Prompt the user for a yes/no reply by using the showConfirmDialog method from the JOptionPane class. (Optional) Write simple recursive methods. ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. The while Statement Repetition statements control a block