Reference no: EM13941474
GIVEN THE CODE IN THE ATTACHMENT, develop a test program called CoinCounterTest to test the CoinCounter class.
In the test program do the following:
1. Write client code (in the CoinCounterTest.java file) to create a CoinCounter object called counter.
2. Write client code to call the print method of counter.
3. Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.
4. Write client code to put the value of the coins deposited so far into a double variable called totalValue. Then print totalValue with an identifying label.
5. Write client code to deposit an additional 11 quarters, 8 dimes, 0 nickels, and 100 pennies in counter. Again find out and print the value of the total deposits.
6. Write client code to create an additional CoinCounter object called bankCounter. Make deposits of 30 quarters, 90 dimes, 100 nickels, and 1000 pennies to bankCounter.
7. Write client code to print bankCounter using the print method.
8. Write client code to clear bankCounter and print bankCounter using the toString
method.
Part 2: Answer the following questions:
1. What type of value does getTotalDeposit return?
2. Draw a picture of the object variable counter and the object after the first deposit (7 quarters, 3 dimes, 10 nickels, and 17 pennies).
3. Suppose you created a CoinCointer object called count2 and then called count2.deposit(25, 8, 5, 10). What would count2.getTotalDeposit() return?
Attachment:- CoinCounter (1).zip
What is the price per share of principal after acquisition
: Principal, Inc. is acquiring Secondary Companies for $29,000 in cash. Principal has 2,500 shares of stock outstanding at a market price of $32 a share. Secondary has 1,600 shares of stock outstanding at a market price of $15 a share. Neither firm has..
|
Evaluate marketing opportunity options
: Evaluate marketing opportunity options that address organisational objectives, and evaluate their risks and returns in the selection process.
|
Would malcolm x life had directedness, multiple direction
: Would you say that Malcolm X's life had a directedness, multiple direction, or lack of direction? Briefly describe his experiences with and relationship to white people during the course of his life.
|
Considering purchase of machine for production of latex
: Vandelay Industries is considering the purchase of a new machine for the production of latex. Machine A costs $3,054,000 and will last for six years. Variable costs are 35 percent of sales, and fixed costs are $200,000 per year. Calculate the EAC for..
|
Write client code to call the print method of counter.
: Write client code to deposit 7 quarters, 3 dimes, 10 nickels, and 17 pennies in counter. Output the new status of counter using the toString method.
|
What is the price per share of firm after the acquisition
: Firm A is acquiring Firm B for $25,000 in cash. Firm A has 3,000 shares of stock outstanding at a market value of $21 a share. Firm B has 1,200 shares of stock outstanding at a market price of $17 a share. Neither firm has any debt. The net present v..
|
A loan is to be repaid in level instalments payable
: A loan is to be repaid in level instalments payable at the end of each year for 7 years. The effective annual interest rate on the loan is 4%. After the 4th payment the principal remaining is $5000. Find the amount of the loan.
|
What is the overall completion percentage for wip
: What is the overall completion percentage for WIP as to direct materials at the end of the period?
|
Differentiate peacemaking and deontological philosophy
: Obviously, both of these cases fell under the Capital Murder statutes of both states. Differentiate the peacemaking philosophy and deontological philosophy in the context of capital murder sentencing for juveniles?
|