Write a program that reads an unknown number (but no more than 100) of integer values from
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a program that reads an unknown number (but no more than 100) of integer values from a file (“ass5_Q4_input.txt”), and displays distinct number. (i.e. if number appears multiple time, it is displayed only once.)
- A while loop can be used to read integer values (one number at a time) till end of the file is reached.
- An array (with maximum size 100) can be used to store inputted number.
- Each inputted number will be stored into the array only if it is new. Otherwise discard it.
- At the end, the array contains only distinct numbers, therefore can be displayed.
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date: