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

  Write program in java for total amount of customer-s order

Write down program in Java which would ask for clerk to enter total amount of customer's order. Program will then compute seven percent (7%) sales tax.

  Prepare a class called geometrycalculator

Calculates the area of a circle of a given radius and write a class called GeometryCalculator that includes the subsequent methods

  Create an array that will store temperatures

Create an array that will store 7 temperatures. Populate the array with 7 random temperatures from 1 to 100 degrees. (hint use a for loop and a Random number Generator)

  Question a jsp expression can contain any java expression

question a jsp expression can contain any java expression that evaluates to aa string objectb java objectc primitive

  Specify, design, and implement a class

Specify, design, and implement a class that can be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  Role of object oriented programming in modern programming

the role of Object Oriented programming in modern programming solutions

  Create an employee class.

Create an Employee class. Items to include as data members are employee number, name, date of hire, job description, department, and monthly salary.

  Write a complete java program to simulate ahmed''s show

Suppose you're on a game show and you're given the choice of three doors. Behind one door is a car; there is nothing behind the others. The car and is placed randomly behind the doors before the show. The rules of the game show are as follows:

  Techniques used to secure web servers

Two of the most popular web servers are Apache and Microsoft IIS. Discuss some of the tools and techniques used to secure these web servers.

  Prompt the user to enter a positive integer

Create a project called Daily8. Add a C source file to the project named daily8.c. Write a program that  will prompt the user to enter a positive integer.

  Write a class to represent a credit card.

write a class to represent a credit card.

  Java :a user-defined starting position (other than 0,0)

modifying the program so that it can start from a user-defined starting position (other than 0,0) and search for a user defined ending point (other than row-1, column-1) .

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