Question: In Java Program 1: OOP and Output to a File Construct and implement a Roman Veral class to store a roman numeral (string) and its

In Java
In Java Program 1: OOP and Output to a File Construct and

Program 1: OOP and Output to a File Construct and implement a Roman Veral class to store a roman numeral (string) and its computed decimal value For example: Roman numeral : XX Decimal Value: 20 Code Guidelines 1. Include a default and an explicit constructor 2. Add the methods shown below: setRoman Value String t) -resets a roman numeral to a specified string, Roman Value) - returns the roman numeral as a string. getDecimal Valuel) returns the decimal value of the roman numeral cqualo) returns true if the roman numeralis equivalent in value to another Roman Numeral object, else return false increment increments the roman numeral by 3. During Romantimes, order did not matter. Use the following decimal values of roman numbers: M: 1000 D: 500 C100 L : 50 X:10 V:5 1:1 4 Write a test app to verify all the member methods function correctly. You may use the est code below Add a list task to write the results of the test cases to a text file. This will require you to use a tryck block public class Kaip public static void main String[args) { System.out.println("Test Application for the Homannumeral class "> W/ DECLARE TWO ROMAN NUMERALS USING EXPLICIT AND DEFAULT CONSTRUCTORS. Romanumeral xl new Romanbluneral"DXI") Roman Numeral new Moral // BUILD A STRING CONTAINING ALL THE REQUIRED TEST CASE OCENARIOS String testas Results - // TEST 1: VERITY THE INITIAL VALUES OF 1 AND 2. COISPARE BOTH OBJECTS testCaseResultaxi. xi.ge Romanvaient with a decimal value of xt.getDecimalValue). In testCaseResults * x2 + x2. get Romasa) + with a decimal value of +*2.getDecimalValue() + " " testCaseResults + xl and x2 are equal? + xl.equal tox2) + " "; // TEST 2: RESET THE ROMAN VALUE FOR X2 AND COMPARE BOTH OBJECTS AGAIN testCascaults Reset 20 + " "; *2.stomatal XID"); teatCasellesults + x2 is now + x2.getRomaValue + with a decimal value of x2.getDecimalValue() + " "; tastasesta *xl and 2 are equal? *l.equalto (21+ " "; // TEST 3 INCREMENT X2 AND COMPARE BOTH ORECTS AGAIN testCase Results + Increment x2 + X2. inerent testcaselesaits: 2 Isox2.get Roman value with a decimal value of22.getDecimalvale) + " "; testCase Results xl and x2 are equal? *1.equalto (2) + " ") //DISPLAY THE TEST CASE RESULTS STRING TO THE CONSOLE System.out.print(testCanckealta): TINAL TASK: WRITE THE TEST CASE RESULTS 90 A TEXT FILE

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!