Suppose that we want to store digitized audio information in a binary file. An audio signal typically does not change much from one sample to the next. In this case, less memory is used if we record the change in the data values instead of the actual data values. We will use this idea in the following program. Write a program StoreSignal that will read positive integers, each of which must be within 127 of the previous integer, from the keyboard (or from a text file, if you prefer). Write the first integer to a binary file. For each subsequent integer, compute the difference between it and the integer before it, cast the difference to a byte, and write the result to the binary file. When a negative integer is encountered, stop writing the file.
What will be an ideal response?
See the code in StoreSignal.java.
Computer Science & Information Technology
You might also like to view...
Dial-up Internet access is the slowest Internet connection
Indicate whether the statement is true or false
Computer Science & Information Technology
All of the following could produce a #NAME? error except ________
A) Invalid arguments in a function B) Misspelled word C) Invalid Function Name D) Invalid Range Name
Computer Science & Information Technology