/*
 * ChangeAdder2.java
 * Dave Sullivan (dgs@cs.bu.edu)
 *
 * This program determines the value of some coins both in cents and
 * in dollars.
 */

public class ChangeAdder2 {
    public static void main(String[] args) {
        int quarters = 10;
        int dimes = 3;
        int nickels = 7;
        int pennies = 6;
        int cents;        

        // compute and print the total value
        cents = 25*quarters + 10*dimes + 5*nickels + pennies;
        System.out.println("Your total in cents is:");
        System.out.println(cents);
     
        // This line doesn't work, because we get integer division:
        //    double dollars = cents / 100;

        // The following line does work, because using a double value
        // (100.0) for the second operand gives us floating-point division.
        double dollars = cents / 100.0;
        System.out.print("Your total in dollars is: ");
        System.out.println(dollars);
    }
}
