Jump to content

Calling Java Folks...help Needed..


Recommended Posts

Posted

Create a CostDomainObject named as CostDTO(like Data transferobject or value object) with two attributes, costid as type string and costAmount as type BigDecimal.

Create Interface CostCalculator taking above CostDTO object as 2 Arguments
1. CostDTO add(CostDTO arg1, CostDTO arg2);
2. CostDTO substract(CostDTO arg1, CostDTO arg2);

Implement the above two methods. You are creating those methods to sum up or substract cost amounts based on costid.

Throw a checked exception when the costids are not the same.

create List with the following Values using the above class.

Costid|Amount|
1 |100.50
2 |20.111
1 |-11.00
3 |3.01
4 |4.0
5 |5.0
6 |6.0
8 |12.00000001




Can any one write a program for the above requirement....

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

  • gudboy999222

    30

  • cherlapalli_jailer

    20

  • vissu

    3

  • bad__boy

    2

Top Posters In This Topic

×
×
  • Create New...