Java help

I need someone to do project 2 for me, I have included the pdf. I need it completed by sunday evening. I have included project 1 because project 2 builds on project 1.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

import javax.swing.JOptionPane;
/******************************************************************************************
*
* Roman Numeral Application
* Computer Science 212, Spring 2013
*
* An input file name should be given on the command line.
* Its contents will be read, converted to Roman numerals, stored in an array,
* sorted and printed.
* Invalid Roman numerals will be printed to the console and discarded.
*
******************************************************************************************/
public class Project1 {
public static final int MAX_ROMAN_NUMERALS = 100;
public static void main (String[] args) {
String inputLine;
int arrayLength =0;
RomanNumeral myRomanNumeral;
RomanNumeral[] romanNumeralList = new RomanNumeral[MAX_ROMAN_NUMERALS];
//
// If there is no command line argument for the file name a message will be
// displayed and the program terminated.
//
if (args.length == 0) {
JOptionPane.showMessageDialog(null,” There is no input file given on the command line.”);
System.exit(0);
}
//
// The file is opened and each line is read, converted to a Roman Numeral and
// stored in the array.
//
TextFileInput in = new TextFileInput(args[0]);
inputLine = in.readLine();
while (inputLine != null) {
try {
myRomanNumeral = new RomanNumeral(inputLine);
romanNumeralList[arrayLength++] = myRomanNumeral;
}
catch (IllegalArgumentException iae) {
System.out.println(“Illegal Roman numeral: “+inputLine);

}
finally {
inputLine = in.readLine();
}
} // while
//
// Print out all the valid Roman numerals in the order in which they were read.
//
System.out.println(“Original:”);
for(int i=0;i

/***************************************************************************
*
* A class for RomanNumerals.
* Project 1, CSCI 212
*
* @author K. Lord
*
*/
public class RomanNumeral {

private String rn;
/****************************************************************************
* Create a new RomanNumeral object from a String.
*
* @param rnString A string made up of I,V,X,L,C,D,M
* @exception IllegalArgumentException
* If the string contains characters other than I,V,X,L,C,D,M
*/
public RomanNumeral (String rnString) {
if (! isValidRomanNumeral(rnString))
throw new IllegalArgumentException(“Bad roman numeral: “+rnString);

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

rn=rnString;
}
/****************************************************************************
* Returns the string version of the Roman Numeral
*
* @return The String value of the Roman Numeral.
*/
public String toString() {
return rn;
}
/****************************************************************************
* Determine if two Roman Numerals are equal (have the same string value)
*
* @return boolean
*/
public boolean equals(Object obj) {
if (obj == null || getClass() != obj.getClass())
return false;
RomanNumeral other = (RomanNumeral) obj;
return (!rn.equals(other.rn));
} // equals
/****************************************************************************
* Calculate the integer value of the Roman Numeral.
*
* @return the integer value of the Roman Numeral
*/
public int getDecimalValue() {
int result = getCharValue(rn.charAt(rn.length()-1));
for (int i=rn.length()-2; i >=0; i–)
if (getCharValue(rn.charAt(i))

/***************************************************************************
*
* A class to sort RomanNumerals.
* Project 1, CSCI 212
*
* @author K. Lord
*
*/
public class RomanNumeralSort {
/**
* Sorts an array containing Roman Numerals in ascending order
*
* @param numerals Partially-filled array of RomanNumerals
* @param size The size of the array that is filled.
*/
public static void sort(RomanNumeral[] numerals, int size) {
//
// Selection Sort.
// Find the smallest value in the array and swap it with the
// top value. Continue this process starting at successive
// cells in the array.

for (int i = 0; i < size - 1; ++i) { int indexLowest = i; for (int j = i + 1; j < size; ++j) { if (numerals[j].compareTo(numerals[indexLowest]) < 0) indexLowest = j; } RomanNumeral temp = numerals[indexLowest]; numerals[indexLowest] = numerals[i]; numerals[i] = temp; } } }

Still stressed with your coursework?
Get quality coursework help from an expert!