Sub program
Errors for sub program:public class CashRegister { public CashRegister() { purchase = 0; payment = 0; } public void recordPurchase(double amount){ double purchase = purchase + amount; } public void enterPayment(int dollars; int quarters; int dimes; int nickels; int pennies){ double payment = dollars + quarters*QUARTER_VALUE + dimes*DIME_VALUE + nickels*NICKEL_VALUE + pennies*PENNY_VALUE; } public double giveChange() { double change = payment - purchase; purchase = 0; payment = 0; return change; } private double purchase; private double payment; public static final double QUARTER_VALUE = 0.25; public static final double DIME_VALUE = 0.1; public static final double NICKEL_VALUE = 0.05; public static final double PENNY_VALUE = 0.01; }
--------------------Configuration: CashRegister - jre6 <Default> - <Default>-------------------- C:\Users\Name\Documents\JCreator Pro\MyProjects\CashRegister\src\CashRegister.java:9: ')' expected public void enterPayment(int dollars; int quarters; int dimes; int nickels; int pennies){ ^ C:\Users\Name\Documents\JCreator Pro\MyProjects\CashRegister\src\CashRegister.java:9: ';' expected public void enterPayment(int dollars; int quarters; int dimes; int nickels; int pennies){ ^ 2 errors Process completed.
Main program
Errors for main program:
--------------------Configuration: CashRegisterTester - jre6 <Default> - <Default>-------------------- C:\Users\Name\Documents\JCreator Pro\MyProjects\CashRegister\src\CashRegisterTester.java:3: cannot find symbol symbol : class CashRegister location: class CashRegisterTester CashRegister register = new CashRegister(); ^ C:\Users\Name\Documents\JCreator Pro\MyProjects\CashRegister\src\CashRegisterTester.java:3: cannot find symbol symbol : class CashRegister location: class CashRegisterTester CashRegister register = new CashRegister(); ^ 2 errors Process completed.
Please help!
I get the feeling that the main just can't seem to find the sub.