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
Explain the halting problem Given a computer program and an input to it, verify whether the program will halt on that input or continue working indefinitely on it.

Algo rithm to Insert a Node p at the End of a Linked List is explained below Step1:   [check for space] If new1= NULL output "OVERFLOW" And exit Step2:   [Allocate fr

Example of Area Subdivision Method The procedure will be explained with respect to an illustrative problem, with the image consisting of five objects, namely a triangle (T), qu


First - Fit Method: -    The free list is traversed sequentially to search the 1st free block whose size is larger than or equal to the amount requested. Once the block is found it

Depth-first traversal A depth-first traversal of a tree visit a node and then recursively visits the subtrees of that node. Likewise, depth-first traversal of a graph visits

what are grounded header linked lists?

a) Run your program for α = 0.05, 0.5, and 0.95. You can use n = 30, and W = 10. What is impact of increasing value of α on connectivity of G'? To answer this question, for each v

To delete an element in the list at the end, we can delete it without any difficult. But, assume if we desire to delete the element at the straining or middle of the list, then, we

A LGORITHM (Deletion of an element from the linked list) Step 1  Begin Step 2  if the list is empty, then element cannot be deleted Step 3  else, if the element to be del