Program 2 : pgm2Ecgs3767OS Class : CGS3767 Operating Systems Instructor : Michael Robinson e-mail : michael.robinson@cs.fiu.edu Worth 10 points *** make sure to follow my Java programming format *** http://users.cis.fiu.edu/~mrobi002/includes/JAVA_programmingRules This program contains two parts: For this assignment you can use your own laptop or the buffalo server provided by FIU. ALL WORK TO BE SUBMITTED IN CLASS OR THE LAB Using your Windows and Ubuntu VIRTUAL MACHINES One: ==== Program OneA: Worth 5 points - Program must be named: yourLastNameFirstLetterOfYourFirstNamepgm2A.java - Turn in the signed source code on paper, and email me the source code. - Make sure the program is properly documented and aligned uniformally, looking professionally, I will take points off if it not. - Include the following header in every program: /********************************************************************* Author : Your Name Course : CGS 3767 days and time Professor : Michael Robinson Program # : Program Purpose/Description {A brief description of the program } Due Date : MM/DD/YYYY Certification: I hereby certify that this work is my own and none of it is the work of any other person. ..........{ your signature }.......... *********************************************************************/ Purpose of this program: - In Ubuntu VIRTUAL MACHINE, terminal mode, create a Java program using any available editor - Compile this program: javac robinsonMpgm1.java - Run this program: java robinsonMpgm1 - Create a Java program in Ubuntu using any editor *** DO NOT USE IDE like eclipse or netbeans *** - Windows : From the command line (cmd), use the notepad editor - Ubuntu : From the Terminal mode use gedit or nano or pico or vi or vim editor - Compile and run this program using the cmd or Terminal javac robinsonMpgm1.java java robinsonMpgm1 Program: - Create a 10 x 10 two dimensional array of int data type - Load each index location in the array with the sum of it's row + column - Display the array with their current values ( perfectly square ) - Create and algorithm that will add all the values in the diagonal indexes from 0,0 to 9,9 and print the total - Create and algorithm that will add all the values in the diagonal indexes from 0,9 to 9,0 and print the total - Print the addition of both diagonals How: - From the main method create the rows and columns variables with their values - From the main method call a method named arrays passing rows and columns - In the arrays method do the rest of the program Two: ==== Program Two: Worth 5 points - Program must be named: yourLastNameFirstLetterOfYourFirstNamepgm2B.sh - Turn in the signed source code on paper, and email me the source code. - Make sure the program is properly documented and aligned uniformally, looking professionally, I will take points off if it not. - Include the following header in every program: /********************************************************************* Author : Your Name Course : CGS 3767 days and time Professor : Michael Robinson Program # : Program Purpose/Description {A brief description of the program } Due Date : MM/DD/YYYY Certification: I hereby certify that this work is my own and none of it is the work of any other person. ..........{ your signature }.......... *********************************************************************/ Purpose of this program: Learn to do shell programming in Linux - *** All the following tasks MUST be done using Linux commands in terminal mode as learned in class.*** - Go into your virtual machine and load up Ubuntu - Create a folder called : program2 - Move to your program2 folder - Download into the program2 folder this file: http://users.cis.fiu.edu/~mrobi002/downloads/pseudomonas_aeruginosa/pa01nov2006/NC_002516.gbk 1 - Create a linux Script file called yourLastNameFirstLetterOfYourFirstNamepgm2B.sh Write inside your *.sh file all the commands needed so that when you execute your *.sh file the following will be execute: 2 - Write the name of the file just created with all its atributes into a new file called stats.txt 3 - Change access rigths as follows: chmod 755 yourLastNameFirstLetterOfYourFirstNamepgm2B.sh 4 - Again, write the name of the file just created with all its atributes into a file called stats.txt 5 - Display program two Starting 6 - Create a directory called dna 7 - Find out how many words, lines/row/records, and how many bytes are in the NC_002516.gbk file writing that information to a new file called dnaCount.txt to be written into the dna folder. 8 - Display the first 5 lines of the dnaCount.txt file and write its output to a to a new file named dnaCount2.txt, in the current directory 9 - Using the cat command merge the following files: dnaCount.txt, NC_002516.gbk, dnaCount2.txt into a new file called merged.txt in the dna folder. 10 - Display the first 3 lines of the file merged.txt