1 – Worth 5 points
In your Ubuntu VM (virtual machine), using terminal mode ONLY, do the following:
Create the folder pgm2
In this folder place the text file located on my faculty website in Module 2 called RAMerrors
Each record in this file represents the location of an error found in RAM
Assume you have a computer with 4 gigs of RAM, each gig in a
different 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,184 bits
RAM chip 2 contain addresses: 17,179,869,185 – 25,769,803,768 bits
RAM chip 3 contain addresses: 25,769,803,769 – 34,359,738,368 bits
HINT: RAM chip 0 contain addresses: 0 – 1,073,741,823 bytes
RAM chip 1 contain addresses: 1,073,741,824 – 2,147,483,648 bytes
RAM chip 2 contain addresses: 2,147,483,647 – 3,221,225,471 bytes
RAM chip 3 contain addresses: 3,221,225,472 – 4,294,967,296 bytes
In the same folder, in terminal mode using an editor, create a Java program
to do the following:
– Open the text file
– Read each record
– Print the RAM memory chip where the error is located for each record
*** CREATE YOUR OWN METHODS THAT WILL CONVERT
HEX TO BINARY AND BINARY TO DECIMAL
*** DO NOT USE JAVA’S AUTOMATIC CONVERSION METHODS
2 – Worth 2.5 points. Using Linux Shell Scripting.
– Implement division by 0, with error trapping, using if and while commands,
How:
– NOT using editors, create a sh file named: yourLastName, firstNameInitial, pgm2.sh
– Set this *.sh file to: chmod 755 *.sh
– NOT using editors, append your name, current date and time to a NEW file called results.txt
– NOT using editors, append to the *.sh file, all the commands needed so that when you execute your sh file,
this file will produce the following:
– Using two variables: FirstNumber and LastNumber, use a while loop.
– Ask the user to enter the first number.
– Ask the user to enter the second number.
– If the user enters the value 99 for the first or the second number, you must exit the while loop immediately,
and terminate your *.sh program.
– If the second number is ZERO inform the user that you CAN NOT divide by ZERO, and ask for a correct second number.
– If the second number is NOT a zero, do the division, display all numbers on this computation using labels,
and add the numbers to the results.txt file.
example: 4 divided by 1 = 4
3 – Worth 2.5 points. Linux Shell Scripting.
– NOT using editors, append to the *.sh file, all the commands needed so that when you execute your sh file,
this file will produce the following:
How:
– Use a for loop from 1 to 100.
– Find the results of calculating each number from (1 to 100 mod 5) + 3.
– After the for loop ends, display the average for all previous results and
append them to the results.txt file.
Let me know if this is possible