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
A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is called as a   Queue.

QUESTION Explain the following data structures: (a) List (b) Stack (c) Queues Note : your explanation should consist of the definition, operations and examples.

Determine the precondition of a binary search For instance, precondition of a binary search is that array searched is sorted however checking this precondition is so expensive

Determine in brief the Painter Algorithm a) The farthest polygon, namely the rectangle PQRS, is stored first. (b) The next farthest, the quadrilateral ABCD, is superpo

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t

Illustrate an example of algorithm Consider that an algorithm is a sequence of steps, not a program. You might use the same algorithm in different programs, or express same alg

#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..

In this example, suppose the statements are simple unless illustrious otherwise. if-then-else statements if (cond) { sequence of statements 1 } else { sequence of st

H o w can you r ot a t e a B i n a r y Tr e e? E x pl a i n r i g h t a n d l eft r ot a tion s by taking an e x a mpl e.   If after

implement multiple stack in one dimensional array