MonetaryCoin - public void setValue(int money value = money...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Author: Lewis and Loftus // // Solution to Programming Project 7.1 //******************************************************************** public class MonetaryCoin extends Coin { private int value; //----------------------------------------------------------------- // Sets up a coin with a value. //----------------------------------------------------------------- public MonetaryCoin (int money) { super(); value = money; } //----------------------------------------------------------------- // Sets the value of the coin. //-----------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public void setValue (int money) { value = money; } //-----------------------------------------------------------------// Returns the current value of the coin. //-----------------------------------------------------------------public int getValue () { return value; } //-----------------------------------------------------------------// Returns a description of this coin as a string. //-----------------------------------------------------------------public String toString() { String result = super.toString(); result += "\t" + value; return result; } }...
View Full Document

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Ask a homework question - tutors are online