Escolar Documentos
Profissional Documentos
Cultura Documentos
Infinite Loops
Ch06_extra01
Ch06_extra03
Displays the number as a percentage out of 75.
Ch06_extra04
Displays the result when 2 is raised to the power of the number.
Chapter 6: Repetition — Additional Exercises
Page 2 of 5
Conditional Loops
Ch06_extra05
Revise the program above to stop and display the message “Program has finished” when
the user enters a negative number.
Ch06_extra06
Create a program that tells users they are about to play a guessing game, where they will
try to guess a mystery letter of the alphabet (lower case letters only). Tell them “Sorry,
wrong guess” for an incorrect guess and “Congratulations, you are correct!” for a correct
guess.
Or
Ch06_extra07
Revise the previous guessing game so that there are three correct letters.
Chapter 6: Repetition — Additional Exercises
Page 3 of 5
Counted Loops
Ch06_extra08
Revise the program on page 103 of the text book to calculate the average of a person’s
six paycheques. Show dollar signs and two decimal places.
Ch06_extra09
Enter and run the following program:
Ch06_extra10
Revise the previous program so a wrong guess receives response in the pattern, “Sorry wrong
guess. That was guess 1.”
Chapter 6: Repetition — Additional Exercises
Page 4 of 5
Counting in Multiples
Ch06_extra11
This program tests the user’s understanding of Turing’s counting in multiples feature.
Ch06_extra12
Revise the previous program so that the user inputs not only the guess but also the
multiple, the start number and the stop number.
Chapter 6: Repetition — Additional Exercises
Page 5 of 5