Identify why the two tests fail and correct the code

Assignment Help Programming Languages
Reference no: EM13782696

Download and study the code provided in the BlueJ project roman_numerals_buggy.zip. Rename this BlueJ project to roman_numeral_soln (this is the BlueJ project you will be submitting). You can rename the project by renaming the folder from roman_numerals_buggy to roman_numeral_soln after extracting the zip file. The purpose of this code is to convert Arabic numerals into Roman numerals. Make an instance of RomanNumerals and invoke the method toRoman(int n). Enter a number in the Arabic notation and it will convert it to a Roman numeral. For example "17" will be converted to "XVII".You will notice a test suite that we provide with the code. Run the test suite by right-clicking on RomanNumeralsTest and choosing Test All as shown in Figure 6.3 of the book. Alternatively, you can click on the Run Tests button as shown in Figure 6.2 of the book, if you have enabled the ‘Show unit testing tools' preference. To enable it, go to Tools > Preferences > Miscellaneous, and select ‘Show unit testing tools'.

You will notice a total of eight tests of which two fail.

Your first task in this assignment is to study the given code, identify why the two tests fail, and correct the code.

On studying the code further, you will notice a few more bugs/limitations in the provided code (i.e. the provided code will not give the correct Roman numeral conversion for some numbers). Identify them and correct the code to handle those situations also.

Also, the test suite itself has a bug, i.e. it will flag an error in a particular case even when the code gives the right answer. Identify that situation and correct it.

Add five more tests to RomanNumeralsTest to give you confidence that all numbers between 1 and 3,000 will be converted correctly.

By the end of this assignment you will have code that converts from Arabic numerals to Roman numerals which handles all possibilities and is fully tested by an additional five tests (hence, a total of 13 tests: eight we provide and five you write).

Reference no: EM13782696

Questions Cloud

Performance based interview questions : Purpose - The list of Performance-Based Interview (PBI) questions presented below has been developed to assist interviewers and selecting officials who have been trained in the PBI process to conduct more effective performance-based interviews.
Mental health field in social work. : Briefly discuss Dorothea Dix and her contribution to the mental health field in Social Work.
Problem related to the globalization : Describe how globalization has changed the way American companies are doing business. In what ways do you believe this change has benefited American organizations and/or their customers?
Twin- income and dual-career families : Respond to the following questions: Among twin- income and dual-career families, do you think there will ever be an equal sharing of household work?
Identify why the two tests fail and correct the code : Your first task in this assignment is to study the given code, identify why the two tests fail, and correct the code.
Organizational design article analysis : Locate an article concerning the future of organizational design. Write a 350- to 700-word paper in which you analyze your selected article. In your analysis, briefly summarize the article and examine the future of organizational design.
Write a responce paper about the movie the warriors : Write a responce paper about the movie The warriors.
Generalizability, utilitarian, and virtue ethics tests. : Evaluate the choices faced by Steve Lewis, Peter Adario, and Eduoard Sakiz (in Badaracco's article) from the standpoints of the generalizability, utilitarian, and virtue ethics tests.
What makes some companies more profitable than others : What makes some companies more profitable than others? What are the similarities and differences between profit and profitability?

Reviews

Write a Review

Programming Languages Questions & Answers

  Communicate with a pc using the rs232c serial protocol

In this assignment we will use the UART0 peripheral to communicate with a PC using the RS232C serial protocol.

  Explaining data-driven multicast routing paradigm

The data-driven multicast routing paradigm works best on local networks that have low delay and excess capacity, while the demand driven paradigm works best in a wide are environment.

  Write program to merge two files that contain polynomials

Write a program that merges two files that contain polynomials. To merge two files, the input files must be in sorted order.

  Write program to reads student-s name with test scores

Write down a program which reads student's name together with his or her test scores. Program must calculate the average test score for each student and allot the suitable grade.

  Write program to compute summation of four grades

when user press, the program computes summation of four grades (Grade1+Grade2+Grade3+Grade4) and print the result in the picture box (picSum).

  Determine total cost of order-display it in alert dialog box

After you determine the total cost of the order (purchase plus shipping and handling), display it in an alert dialog box.

  Write a program which defines an integer array of size

Write a program which defines an integer array of size three (3), the size of the array should be a constant variable. Read data using loops for this array from the user. The data of this array will be the number of vacation days of an employee in..

  Program for class quiz to implement measurable interface

State a class Quiz to implement Measurable interface. A quiz has a score and a letter grade (such as B+).

  Design classes account-checkingaccount and savingsaccount

Design and write 3 classes - Account, CheckingAccount, and SavingsAccount. Have CheckingAccount and SavingsAccount inherit from Account.

  Write code using while loop for data validation

Write code or pseudo code using while loops to do Data Validation for following user prompts:input positive # input negative # input number between 1 and 100, inclusive.

  Formulae to calculate their center point

Given n points in the 3D space (xo, yo, zo), (x1, y1, z1), (xn-1,yn-1, zn-i), we use the following formulae to calculate their center point (xc, yc, zc)

  Clear description of the program you are building

Your final project will be to analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as function and subprogram calls and uses arrays...

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd