Cash-back offer from May 7th to 12th, 2024: Get a flat 10% cash-back credited to your account for a minimum transaction of $50.Post Your Questions Today!

Question DetailsNormal
$ 24.00

Lab Assignment #2 Creating Classes | Complete Solution

Question posted by
Online Tutor Profile
request

Lab Assignment #2
Creating Classes

The purpose of this lab is to gain experience in the design and implementation of a simple Java class.  You will create a class definition and write a simple main method that will test the methods of your class to ensure they work as expected.

The required task is to create a class definition for the concept of a Roman numeral.  When a Roman numeral object is declared, it should hold a representation of the Roman numeral (e.g., MMXV) and provide the following functionality:
•    A constructor that initializes the Roman numeral to the value supplied as the parameter to the constructor in Roman numeral format
•    A constructor that initializes the Roman numeral to the value supplied as the parameter to the constructor in decimal format
•    A method that returns the value of the Roman numeral
•    A method that returns the decimal equivalent of the value of the Roman numeral
Note: a Roman numeral object is only allowed to permanently store the Roman numeral representation of the number (i.e., adding an int member for the decimal equivalent is not allowed).

Your test program must create Roman numeral objects and enable the user to sufficiently test the class methods for correctness.  I/O can be console based – e.g., you may want to prompt the user for a Roman numeral, create a Roman numeral object and then output the numeral in both Roman numeral and decimal format.

The extended task is to add functionality to the class to add Roman numerals.  Note to get any credit for this method this addition must be done using the Roman numeral format of the numbers, not by converting them to decimal values and adding those.  Your test code should be extended to allow the user to exercise the add function as many times as desired.

As a reminder, these are the decimal values of the Roman numeral “digits”:

    M    1000
    D    500
    C    100
    L    50
    X    10
    V    5
    I    1

Submit your project folder (zipped) using the link provided on the assignment section of Blackboard.

Available Answer
$ 24.00

[Solved] Lab Assignment #2 Creating Classes | Complete Solution

  • This Solution has been Purchased 1 time
  • Submitted On 13 Sep, 2015 08:07:37
Answer posted by
Online Tutor Profile
solution
public class RomanNumeral { private String roman = ""; // instance variable for the Roman numeral private int value; // instance ...
Buy now to view the complete solution
Other Similar Questions
User Profile
NUMBE...

Unit 5 Lab Assignment: Closeout and Termination

Unit 5 Lab Assignment: Closeout and Termination The Final Project Report is the administrative record of the completed project that identifies all its functional and technical components, as well as other important project hi...
User Profile
NUMBE...

Unit 4 Lab Assignment: Resource Leveling

Resource loading is used to describe the amounts of individual resources that an existing schedule needs during a specific time period. The load requirements of each resource type are then listed as a function of the time per...
User Profile
NUMBE...

CIS 223 Unit 2 Lab Assignment 1

1. What is the difference between a database and a table? 2.What does it mean to say that a database displays both entity integrity and referential integrity? 3.Why are entity integrity and referential integrity important in...
User Profile
rckum...

CIS 223 Unit 2 Lab Assignment 1

CIS 223 Unit 2 Lab Assignment 1 If any issues please reply me thanks ...
User Profile
Assig...

NURS 6512C Nursing LAB ASSIGNMENT ASSESSING THE ABDOMEN

Your assignment is attached. Thanks for purchasing this assignment!...

The benefits of buying study notes from CourseMerits

homeworkhelptime
Assurance Of Timely Delivery
We value your patience, and to ensure you always receive your homework help within the promised time, our dedicated team of tutors begins their work as soon as the request arrives.
tutoring
Best Price In The Market
All the services that are available on our page cost only a nominal amount of money. In fact, the prices are lower than the industry standards. You can always expect value for money from us.
tutorsupport
Uninterrupted 24/7 Support
Our customer support wing remains online 24x7 to provide you seamless assistance. Also, when you post a query or a request here, you can expect an immediate response from our side.
closebutton

$ 629.35