Creates an object of type pocket to be used

Assignment Help Programming Languages
Reference no: EM132217512

Question: How wTakes in a coin name as part of the constructor and stores it in a private string Has a method that returns the coins name
Has an abstract getvalue method

Create four children classes of Coin.java with the names Penny, Nickle, Dime, and Quarter that includes the following:

A constructor that passes the coins name to the parent

A private variable that defines the value of the coin

A method that returns the coins name via the parent class And any other methods that should be required.

Create a Pocket class that includes the following:

An ArrayList of type coin to manage coins.(You MUST use an ARRAYLIST) A method that allows a coin to be added

A method that allows a coin to be removed

A method that returns a count of the coins in your arraylist by coin type.

A method that returns a total value of all the coins in your arraylist

Create a NoSuchCoin class that will act as your custom exception (see pg.551 in book). Create a PocketMain class that includes the following :

Creates an object of type pocket to be used below

A main method that prompts the user with a menu of options to include:

Add a coin (must specify type) Remove a coin (must specify type) Display a coin count

Display a total value in the pocket An ability to exit the program

This method must handle poor user input somehow using your custom exception

How would I go about on starting this code?

Reference no: EM132217512

Questions Cloud

Create two use cases for the school bus system : The X School operates 40 buses that serve approximately 1,000 students in grades K-12. The bus operation involves 30 regular routes, plus special routes.
Write a class classroom that extends room : A Room class contains an int instance variable for the area (in square feet) of the room one constructor that takes the area of the room.
Design an algorithm for an xml document : An XML document is a plain text file containing opening and closing tags that semantically mark-up pieces of data. Further, tags can be nested as many levels.
Write a proram to take a sequence of numbers from the stack : Write a program to take a sequence of numbers from the stack. The most recent stack value will contain the number of digits to use.
Creates an object of type pocket to be used : How wTakes in a coin name as part of the constructor and stores it in a private string Has a method that returns the coins name Has an abstract getvalue method
What is wrong with the given variable declarations : What is wrong with the following variable declarations? If wrong, explain. If correct (nothing wrong), write "correct". double 1st_var = 10; int var2.
Describe one way that you might be able to improve the speed : Why did it run so slow? Describe one way that you might be able to improve the speed of such a program.
Which method converges faster : Calculation with same initial guess x0 and convergence criterion as before. Finally, attach your code for the secant method and provide MATLAB outputs.
Write a java program using classes and object to read : XYZ Group is a leading construction company in Oman and they are specialize in delivering solutions to diverse businesses in Oman and UAE.

Reviews

Write a Review

Programming Languages Questions & Answers

  What are different string functions in oracle

Write a PL/SQL block to find out greatest number from given three numbers.What are different string functions in ORACLE?

  How many number of users currently logged into the system

How do you know how many number of users currently logged into the system? (Not considering if any user is logged more than one time

  The ideal hpc programming language

The Ideal HPC Programming Language.

  Define a class rewardcard as an adt

Determine the cost of the two_day_ package represented by the instantiated object, then display the calculated cost also on the console - Define a class RewardCard as an ADT that uses separate files for the interface and the implementation

  Write a program to reverse which display all the elements

Write a program "Reverse" which display all the elements in the array in reverse order, (use multiple print statements).

  Using the irvine32 library functions

Create 32 random points which have (x, y) co-ordinates

  What are advantages of using menus in a gui application

What are advantages of using menus in a GUI application? Design a menu structure for a program you would find useful in your work or hobbies. Write and post the code for the menu creation

  How theory designates team member roles and responsibilities

Explain how participation, leadership, and motivational skills would be demonstrated according to this theory.

  Devise an algorithm that finds all modes

Devise an algorithm that finds all modes. (Recall that a list of integers is nondecreasing if each term of the list is at least as large as the preceding term.)

  Write functions to do several types of string processing

Write functions to do several types of string processing. To test these you must write driver programs USING C++ without any errors and it has be executed properly.

  Program for class quiz to implement measurable interface

State a class Quiz to implement Measurable interface. A quiz has a score and a letter grade (such as B+).

  Find use of dom to change the contents of an html text box

This statement will include the names of files or sections of code within a file for which he or she has been solely responsible, and the Web address of files that are visible on the group Web server space. A response such as ‘It was basically a j..

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