Implementation of a simple java class

Assignment Help JAVA Programming
Reference no: EM13920483

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

Reference no: EM13920483

Questions Cloud

Find p-value. : You need to hand in individual work. You may talk with each other about the problems. However, everything in the assignment must be your own work.
Discuss quasi-experimental designs : Jackson (2012), even-numbered chapter exercises, p 360. Describe the advantages and disadvantages of quasi-experiments? What is the fundamental weakness of a quasi-experimental design? Why is it a weakness? Does its weakness always matter?
Description of the features of your product or service : A detailed description of the features of your product or service including how it solves the needs of your target market. A description of how your marketing efforts will change with each phase in the product life cycle
Anonymous reporting of accusations of fraud : ___________ requires that firms in the private sector provide procedures for anonymous reporting of accusations of fraud.
Implementation of a simple java class : 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.
Digital marketing-sales promotion-direct marketing : Write a 6,000- to 7,000-word paper that integrates your previous Learning Team assignments into a final Marketing Plan. In addition to your previous papers, include the following:
Cost of goods sold : Calculate the total dollar amount of cost of goods sold and total dollar amount of ending inventory for October assuming FIFO is used.Calculate total dollar amount of cost of goods sold and total dollar amount of ending inventory for October assuming..
Elements of message syntax on a sequence diagram : Question 3: Explain elements of message syntax on a sequence diagram. Question 4: Describe the risk factors associated with database design
Calculate profit for the year if full cost price is charged : Calculate the profit for the year if a full cost price is charged. Calculate the profit-maximising price. Assume in both (a) and (b) that 50,000 units of timm are produced regardless of sales volume.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Print the initial array and the resulting array

Take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bound..

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  The desired functionality is for your programs to input

the desired functionality is for your programs to input pairs of natural numbers as theyre entered by the user until

  Design a class named large integers

Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

  What things are you struggling to understand

Discuss your experiences with the programming assignment - what things are you struggling to understand?

  What are some resources to cover mental health issues

What are some resources to cover mental health issues in the criminal justice system? Provide a timeline for the resources that will cover the issue.

  Write an application that enables users to enter student ID

Write an application that enables users to enter student ID and three exam scores. Provide a method to compute and returnthe overall exam average.  Provide another method that prints all scores and the average value formatted with no digits to the ri..

  Create a program named schoolsdemo

Create a program named SchoolsDemo that allows a user to enter data about five school objects and then displays the school objects in order of enrollment size from smalles to largest.

  Cmpet 301 lab 11 overview

CMPET 301: Lab 11 Overview, Create a class for one playing card. Make a deck of playing cards by instantiating an array of 52 playing cards playing cards.

  Application named arithmeticmethods

Create an application named ArithmeticMethods whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayNumberPlus10()

  Create an application with a jframe

Create an application with a JFrame that holds five labels describing reasons that acustomer might not buy your product (for instance, "Too expensive").

  Prepare a java program to random pick

The user and computer will each randomly pick one and common rules of winning apply. The game ends when the user and computer pick the same item.

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