In documents, it is frequently necessary to write monetary amounts in a
standard format. We have decided to format amounts as follows:
- the amount must start with '$'
- the amount should have a leading '0' if and only if it is less then 1 dollar.
- the amount must end with a decimal point and exactly 2 following digits.
- the digits to the left of the decimal point must be separated into groups of three by commas (a group of one or two digits may appear on the left).
Create a class FormatAmt that contains a method amount that takes two int's, dollars and cents, as inputs and returns the properly formatted String.
|