BandBooster - public String getName() { return name; }

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

View Full Document Right Arrow Icon
//********************************************************************** // BandBooster.java // // Represents a band booster who sells candy for the band fundraiser. //********************************************************************** public class BandBooster { // Instance variables String name; int boxesSold; //---------------------------------------------------------------- // Constructor - sets up a band booster by initializing the name. //---------------------------------------------------------------- public BandBooster (String boosterName) { name = boosterName; boxesSold = 0; } //---------------------------------------------------------------- // Returns the name of the booster. //----------------------------------------------------------------
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 String getName() { return name; } //----------------------------------------------------------------// Updates the number of boxes of candy sold by adding the // number specified in the parameter to the number sold so far. //----------------------------------------------------------------public void updateSales(int additionalSales) { boxesSold += additionalSales; } //----------------------------------------------------------------// Returns a string representation of a band booster. //----------------------------------------------------------------public String toString() { return name + ": " + boxesSold + " boxes"; } }...
View Full Document

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Ask a homework question - tutors are online