Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write Junit tests, please. using JUnit 4 Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files
write Junit tests, please.
using JUnit 4
Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files (including main to test your work) into a zip file and submit it through Canvas. The grading scheme is provided on Canvas. You are free to use any looping construct of your choice Make sure that you display appropriate messages that are intuitive and clear Use Java's random number generator method (limit it to integers only) Do NOT write the entire logic of the program inside main(). Create separate methods that perform all the work and then invoke it from main() Write Junit Tests for Exercise 1 and 4 only. Note: Use of Arrays is not allowed! Lab Requirements 1. Roman numbers: Write a program that converts a number from Roman number system to positive integer. The Roman number system has digits -> XUOS 10 50 100 500 1,000 Numbers are formed according to the following rules: a) Only numbers up to 3,999 are represented. b) As in the decimal system, the thousands, hundreds, tens, and ones are expressed separately. c) The numbers 1 to 9 are expressed as 1 1 IV 4 VII 7 2 V 5 VIII 8 3 VI 6 IX 9 As you can see, an I preceding a V or X is subtracted from the value, and you can never have more than three ls in a row. d) Tens and hundreds are done the same way, except that the letters X, L, C and C, D, M are used instead of I, V, X, respectively. Your program should include a java method (with appropriate method name, return type and argument lists) and accompanying test program that works in the following manner: Given an input, such as MCMLXXVIII, and it returns an answer after converting it to decimal 1978. Instructions: Please review the requirements given below carefully and complete your work. You should compress all source files (including main to test your work) into a zip file and submit it through Canvas. The grading scheme is provided on Canvas. You are free to use any looping construct of your choice Make sure that you display appropriate messages that are intuitive and clear Use Java's random number generator method (limit it to integers only) Do NOT write the entire logic of the program inside main(). Create separate methods that perform all the work and then invoke it from main() Write Junit Tests for Exercise 1 and 4 only. Note: Use of Arrays is not allowed! Lab Requirements 1. Roman numbers: Write a program that converts a number from Roman number system to positive integer. The Roman number system has digits -> XUOS 10 50 100 500 1,000 Numbers are formed according to the following rules: a) Only numbers up to 3,999 are represented. b) As in the decimal system, the thousands, hundreds, tens, and ones are expressed separately. c) The numbers 1 to 9 are expressed as 1 1 IV 4 VII 7 2 V 5 VIII 8 3 VI 6 IX 9 As you can see, an I preceding a V or X is subtracted from the value, and you can never have more than three ls in a row. d) Tens and hundreds are done the same way, except that the letters X, L, C and C, D, M are used instead of I, V, X, respectively. Your program should include a java method (with appropriate method name, return type and argument lists) and accompanying test program that works in the following manner: Given an input, such as MCMLXXVIII, and it returns an answer after converting it to decimal 1978Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started