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

Got a comment that the image would not display, please try to refresh the page a

ID: 3882964 • Letter: G

Question

Got a comment that the image would not display, please try to refresh the page again or use another browser.

public class Accumulator { private double total: private int N: } public class Transaction { private final String who: private final Date when: private final double amount: } public class FixedCapacityStackOfstrings { private String[] a = new String[C]: // stack entries private int N: // size } class INode implements Comparable { protected byte [] name: protected long modificationTime: protected long accessTime: } class INodeFile extends INode { private long header: private Block [] blocks: } class INodeDirectory extends INode { private INodeFile [] children: } public class Block implements Comparable { private long blockId: private long numBytes: private long generationStamp: } Please answer what size (c) and (d) are with at least 50 words explaining how you made the calculations and assumptions: Assuming a 64-bit CPU architecture and Java 7, given the class definitions described in Listing 1 compute the amount of memory needed by each of the following objects considering their respective assumptions: (c) FixedCapacityStackOfStrings, assuming capacity C=8 and fixed size string entries of size S=8 chars. Remember to include the amount of memory required to store the strings in your calculation. (d) Block Note that in all of your calculations you should assume a 64-bit CPU architecture and Java 7. Don't forget to consider the padding in your calculation.

Explanation / Answer

c) In 64 bit architecture the memory size alloted for a string is 24 bytes, so here we have an array of string.The total length of the array is 8. Now the size of the array object will be equal to 24*8=192

b) The block contains three long type data where each of size 16 bytes,so totally around 16* 3= 48 bytes is the size    of   the BLOCK

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