Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1 Caesar cipher uses a shift of each character by a key with a value be

ID: 3821369 • Letter: Q

Question

QUESTION 1

Caesar cipher uses a shift of each character by a key with a value between 1 and 255. An a with a shift equal to 3 becomes a d. A z would become a c, wrapping around the alphabet.Which is the encryption of shadow for a key = 3?

ukdgry

vkdgrz

adowsha

vjegrz

QUESTION 2

How many bytes does the read method in the FileInputStream class actually return to the program call?

1

2

4

8

QUESTION 3

If you write a simple Student class, what must you do in order to write Student objects to an ObjectOutputStream?

Code a write method.

Make all class variables primitive.

Implement Serializable.

Implement Streamable.

QUESTION 4

Use a ____ object to access a file and move a file pointer.

Random

RandomAccess

RandomAccessFile

System.in

QUESTION 5

Which code stores an array buttonArray of JButton objects in a file named buttonFile? We ignore exceptions in this problem.

QUESTION 6

Based on the code below, the statement that would move the file pointer to byte n counted from the beginning of the file is ___________________.

test.getFilePointer(n);

test.getFilePointer();

test.seek(n);

test.length() – n;

QUESTION 7

Assume we have a RandomAccessFile object, file, which stores a set of records of class MyData. The size of each record is MyData.RECORD_SIZE. Assume MyData has read and write methods, both of which take a RandomAccessFile as an argument. Method write writes the object at the current location. Method read reads the record from current location of the file into the object. If we are currently at the beginning of the 25th record, which code correctly modifies the 25th record by changing its color to Color.yellow through the setColor method?

QUESTION 8

Every object is assigned a serial number on the stream. What might be the result if the same object is saved twice?

The object will have two serial numbers.

Only the serial number is written out the second time.

A performance decrease.

Running out of serial numbers.

QUESTION 9

Objects saved to an object stream must belong to classes that:

implement the Serializable interface.

are RandomAccessFile objects.

are abstract.

implement the ObjectInputStream interface.

QUESTION 10

Which file storage method is in human-readable form?

binary

object

text

byte

ukdgry

vkdgrz

adowsha

vjegrz

Explanation / Answer

QUESTION 1:

vkdgrz

QUESTION 3:

Implement Serializable.

Because, in order for an object to be serilaized then its class must be serializable.

QUESTION 4:

RandomAccessFile

QUESTION 5:

QUESTION 6:

test.seek(n);

QUESTION 7:

long loc = file.getFilePointer();

QUESTION 10:

text

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote