Part 1 - Java program named MemoryCalculator
In your Ubuntu VM (virtual machine), using terminal mode ONLY,do the following:
Create the folder program2
Each record in this file represents the possible location of anerror found in RAM. (Hint: One of them is not on one of thechips.)
Assume you have a computer with 4 gigs of RAM, each gig in adifferent memory chip, therefore you have 4 one gig RAM chips.
---------decimal---------------
HINT:
RAM chip 0 contain addresses: 0 - 8,589,934,584 bits
RAM chip 1 contain addresses: 8,589,934,585 - 17,179,869,184bits
RAM chip 2 contain addresses: 17,179,869,185 - 25,769,803,768bits
RAM chip 3 contain addresses: 25,769,803,769 - 34,359,738,368bits
HINT:
RAM chip 0 contain addresses: 0 - 1,073,741,823 bytes
RAM chip 1 contain addresses: 1,073,741,824 - 2,147,483,648bytes
RAM chip 2 contain addresses: 2,147,483,647 - 3,221,225,471bytes
RAM chip 3 contain addresses: 3,221,225,472 - 4,294,967,296bytes
In the same folder, in terminal mode using an editor, create aJava program to do the following:
- Call the Java program – MemoryCalculator.java
- Open the RAMerrors file
- Read each record
- Print the RAM memory chip where the error is located for eachrecord
*** CREATE YOUR OWN METHODS THAT WILL CONVERT
HEX TO BINARY AND BINARY TO DECIMAL
*** DO NOT USE JAVA'S AUTOMATIC CONVERSION METHODS
Part 2 - Linux Shell Scripting
- Create a sh file named: program2.sh
- Set the permissions for this this *.sh file using this commandto make it executable: chmod 755 program2.sh
- program2.sh should add your name and the current date and timeto a NEW file called results.txt -program2.sh should then do thefollowing:
How: - Ask the user to enter a number.
- Verify that the number is between 1 and 50, inclusive.
- If the number is not between 1 and 50, then keep asking theuser to enter a number until it is valid.
- Use a loop from 1 to the value entered by the user
- Sum the results of all the included numbers, but do notinclude any output yet.
- After the loop ends, display the sum and append it to theresults.txt file on a new line as follows
Sum of numbers is xxx
The results.txt file should have 3 lines in it when done.
***** Primarily need help with the java program *****