OK, well one way would just be to read in your whole file, modify the values as needed, then write it back out. I'll assume though that your assignment requires you to modify the file in place. The class you need for that is java.io.RandomAccessFile. The good news is that class also has writeDouble(), writeInt(), writeFloat() methods, as well as similar read methods. Where you'll have to practice a bit is using the seek() method to find the right spot in your file to make the change.
Also,
you should understand that none of the writes will change the length of your file. If you try to write an int (4 bytes) into the spot where there was a long (8 bytes), you'll end up with the four bytes of the int followed by the low order four bytes of the long that was there before.