Create accessors for this data structure, Data Structure & Algorithms

Create a Money data structure that is made up of amount and currency.

(a) Write a constructor for this data structure

(b) Create accessors for this data structure

(c) Write operations convert-money (takes a Money object and a currency symbol and returns the Money object of the requested currency), add-money and subtract-money (add and subtract Money objects possibly from different currencies and return a Money object with currency of the first Money object argument)

 

Posted Date: 3/28/2013 3:43:38 AM | Location : United States







Related Discussions:- Create accessors for this data structure, Assignment Help, Ask Question on Create accessors for this data structure, Get Answer, Expert's Help, Create accessors for this data structure Discussions

Write discussion on Create accessors for this data structure
Your posts are moderated
Related Questions
State the complex reallocation procedure Some languages provide arrays whose sizes are established at run-time and can change during execution. These dynamic arrays have an in

need an expert to help me with the assignment

Design  and implement  an algorithm  to simulate car  re-organizing of the train at the railway switching junction. You can only use stacks as the data structure to represent the t

Question a) Describe how the endogenous model is an improvement to the neo-classical model in explaining the long-run effect of investment on economic growth of a country.

What are the conditions under which sequential search of a list is preferred over binary search? Sequential Search is a preferred over binary search when the list is unordered

Define null values.  In some cases a particular entity might not have an applicable value for an attribute or if we do not know the value of an attribute for a particular entit

Ruby implements Range of T Abstract data type Ruby implements Range of T ADT in its Range class. Elements of carrier set are represented in Range instances by recording interna

Q. Define a method for keeping two stacks within a single linear array S in such a way that neither stack overflows until entire array is used and a whole stack is never shifted to

What is Class invariants assertion A class invariant is an assertion which should be true of any class instance before and after calls of its exported operations. Generally

Explain an efficient way of storing a sparse matrix in memory.   A matrix in which number of zero entries are much higher than the number of non zero entries is called sparse mat