Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

07. Seventh Assignment Arabic to Roman Numerals In this assignment, your task is to write a program the converts Arabic numerals (the kind we usually

image text in transcribedimage text in transcribed

07. Seventh Assignment Arabic to Roman Numerals In this assignment, your task is to write a program the converts Arabic numerals (the kind we usually use) to Roman numerals. Your program should be able to handle integers between 1 (the Romans had no way to represent zero, negative, or decimal numbers) and 3999. You should display an error message for numbers outside of this range. Allow the user to continue converting values until the enter -1 to quit. The code for doing the conversion should be contained within a method with the following signature public static String arabicToRoman(int arabic); Part of the task of writing good code that is often overlooked in school is testing your code in a logical way. When you test code, it is important to have tests that cover each of the following situations normal case a standard instance of the problem that tests the basic operation on normal inputs invalid case tests that the program responds appropriately to various types of invalid inputs .boundary case a tricky instance of the problem that tests the operation on inputs that have to be handled in a special way At the bottom of your code in this assignment, include a comment that explains your test plan the inputs you chose for each case, why you chose them, and the results produced by your program. Do NOT write a description of your development or debugging process. Instead, provide a list of normal, invalid, and boundary test cases and the expected results Roman Numerals 10 50 100 500 1000 The Romans thought it would be easier to read if they did not have the same numeral four times in a row, so instead of lI, the number 4 is written IV. Similarly, 9 is written I)x instead of VIIII. 99 is XCIX. Please see Wikipedia if you need more information about Roman numerals. Hint: If you can get your program to produce the Roman numerals but you are having trouble with the rule about not having four of the same character in a row, you might want to consider using the replaceAll method of the String class to 07. Seventh Assignment Arabic to Roman Numerals In this assignment, your task is to write a program the converts Arabic numerals (the kind we usually use) to Roman numerals. Your program should be able to handle integers between 1 (the Romans had no way to represent zero, negative, or decimal numbers) and 3999. You should display an error message for numbers outside of this range. Allow the user to continue converting values until the enter -1 to quit. The code for doing the conversion should be contained within a method with the following signature public static String arabicToRoman(int arabic); Part of the task of writing good code that is often overlooked in school is testing your code in a logical way. When you test code, it is important to have tests that cover each of the following situations normal case a standard instance of the problem that tests the basic operation on normal inputs invalid case tests that the program responds appropriately to various types of invalid inputs .boundary case a tricky instance of the problem that tests the operation on inputs that have to be handled in a special way At the bottom of your code in this assignment, include a comment that explains your test plan the inputs you chose for each case, why you chose them, and the results produced by your program. Do NOT write a description of your development or debugging process. Instead, provide a list of normal, invalid, and boundary test cases and the expected results Roman Numerals 10 50 100 500 1000 The Romans thought it would be easier to read if they did not have the same numeral four times in a row, so instead of lI, the number 4 is written IV. Similarly, 9 is written I)x instead of VIIII. 99 is XCIX. Please see Wikipedia if you need more information about Roman numerals. Hint: If you can get your program to produce the Roman numerals but you are having trouble with the rule about not having four of the same character in a row, you might want to consider using the replaceAll method of the String class to

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions