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

Repetition

Choose the appropriate loop to

  1. annoy the user until s/he types the correct word
  2. display the squares of integers until a non-even integer is typed
  3. sum values until they exceed a user-specifed value
  4. continously accept decimal values and display their mean until the mean reaches zero
  5. accept pairs of numbers until the second is not the exact square of the first
  6. have a user guess the magic number with clues of “higher” and “lower”
  7. have a user guess the magic word with clues of “higher” and “lower”
  8. have a user guess the magic number with clues of “higher” and “lower” or “more digits” and “fewer”
  9. read two integers from a file and display their sum, difference, product, quotient, and power
  10. read two doubles from a file and display their sum, difference, product, quotient, and power
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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.]