# Repetition

Choose the appropriate loop to

- annoy the user until s/he types the correct word
- display the squares of integers until a non-even integer is typed
- sum values until they exceed a user-specifed value
- continously accept decimal values and display their mean until the mean reaches zero
- accept
*pairs*of numbers until the second is not the exact square of the first - have a user guess the magic number with clues of “higher” and “lower”
- have a user guess the magic word with clues of “higher” and “lower”
- have a user guess the magic number with clues of “higher” and “lower” or “more digits” and “fewer”
- read two integers from a file and display their sum, difference, product, quotient, and power
- read two doubles from a file and display their sum, difference, product, quotient, and power
- read from a file two numbers and a character code identifying the numbers as integers or doubles; display the sum, difference, product, quotient, and power of the doubles with appropriate formatting and labels
- read pairs of integers from a file, one pair per line, and write to a second file, with appropriate formatting and labels, the sum, difference, product, quotient, and power of each pair
- read pairs of doubles from a file, one pair per line, and write to a second file, with appropriate formatting and labels, the sum, difference, product, quotient, and power of each pair
- read from a file two integers representing, respectively, the number of following lines which contain pairs of integers and which contain pairs of doubles, and write to a second file, with appropriate formatting and labels, the sum, difference, product, quotient, and power, of each pair
- read lines from a file; if the lines contain pairs of numbers, for each pair, write to a second file, with appropriate formatting and labels, the sum, difference, product, quotient, and power
- read from a file lines containing pairs of numbers; for each pair, write to a second file, with appropriate formatting and labels, the sum, difference, product, quotient, and power

touque.ca > Education Commons > Java > Assignments > Repetition

[This page last updated 2020-12-23 at 12h12 Toronto local time.]

© 2007–2021 Hersch, Bear & Company Limited. All rights reserved. “Grammar Authority,” “grammarauthority.com,” “touque.ca,” and “Canada’s Thinking Cap” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners.

Privacy Policy | Licence to Copy | How to cite | Contact us