Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Snack Machine

JamesCaron
JamesCaron 


The description and the accompanying files and are attached below Attachments Tags
Clarifications

Answers

Java - Snack Machine - Solution

dickersonka
dickersonka 



Attached is the solution to... Attachments
SnackMachine.zip (8 K) Download


Preview
10/19/10 */ package proj3; public enum CookieFlavors {CHOCOLATE_CHIP,

Preview
cookie */ public static final double PRICE = 0.65; private CookieFlavors flavor; /** * Create new cookie * @param flavor Flavor of cookie */ public Cookies(CookieFlavors flavor) { this.flavor = flavor; } /** * Get

Preview
* This file models a mint */ package proj3; import java.awt.Color; public class Mints { /** * Price of a mint */ public static final double PRICE = 0.35; private Color color; /** * Create

Preview
* @param numNickels Number of nickels * @param numDimes Number of dimes * @param numQuarters Number of quarters * <p>Pre-Condition: all units of change are positive * <p>Post-condition: change is saved */ public Money(int numNickels, int numDimes, int numQuarters) { this.numNickels = numNickels;

Preview
package of Mints"; JOptionPane.showMessageDialog(null, msg, "Mints Purchase", JOptionPane.INFORMATION_MESSAGE, mints); } // reset coin spinners resetSpinners( ); } } // Buy Cookies Button private class BuyCookies implements ActionListener { public void actionPerformed(ActionEvent ae) { // read

Preview
getNrCookies() { return this.cookies.size(); } /** * Get number of mints in machine * @return Number of mints */ public int getNrMints() { return this.mints.size(); } /** * Test method for SnackMachine * @param args

Screenshots
Purchase Answer