ints.txt
.doubles.bin
.ints.txt
and displays the sum.ints.txt
rather than overwriting the file each time the program runs.doubles.bin
and displays larger of the two numbers.classDiagram class ListGenerator { -rand: Random$ +generateInts(max: int) List~Integer~$ +generateDoubles(max: int) List~Double~$ +generateStrings(max: int) List~String~$ -generateString(max: int) String$ }where the last method generates a string containing a random number of digits (no more than
max
) and each other method generates a random number of desired objects (no more than max
).void writeDoubles(Path path, List<Double> list)
— write the list to a text file with one value on each linestatic void main(String[] ignored)
— program that generates a list of up to ten doubles and writes it to a file called nums.txt
void readDoubles(Path path, List<Double> list)
— reads a text file filled with doubles and adds each double to the list.static void main(String[] ignored)
— a different program that reads up to ten doubles and from a file called nums.txt
and displays the sum of the valuesvoid writeInts(OutputStream out, List<Integer> list)
— write the list to a text file with one value on each linevoid writeStrings(OutputStream out, List<String> list)
— write the list to a text file with one value on each linevoid readInts(InputStream in, List<Integer> list)
— reads a text file filled with integers and adds each integer to the list.void readStrings(InputStream in, List<String> list)
— reads a text file filled with strings and adds each string to the list.writeDoubles()
and readDoubles()
methods so that they accept a stream instead of a path.