Write client code to call the print method of counter.

Assignment Help JAVA Programming
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

Reference no: EM13941474

Questions Cloud

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?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd