I need the output to be look like this:
Enter the amount of the purchases: (user enters 44.28)
Enter the cash tendered: (user enters 50)
Your change is equal to 5.71999999999 which is...
5 dollars 72 cents
2 quarter (s)
2 dime(s)
0 nickel (s)
2 pennie (s)
-----------------------------------------------------------
As you can see the basic of the program is inform the user how much of each coin they get back with their change... if anyone can help me it would be a huge help!
package lab02; / Purpose: Compute the amount of change a customer should receive (in terms of dollars, quarters, dimes, nickels, and pennies) given the amount of the purchase and the cash tendered. @author jdoe / import java.util.Scanner; public class Change { /* @param args / public static void main(String[] args) { double purchaseAmt; double cashTendered; double totalChange; int dollars, cents; // Create a Scanner object to read from standard input Scanner scan = new Scanner(System.in); // Prompt the user and read in amount of purchase and // cash tendered. System.out.print("Enter the amount of the purchase: "); purchaseAmt = scan.nextDouble(); System.out.print("Enter the cash tendered: "); cashTendered = scan.nextDouble(); totalChange = cashTendered - purchaseAmt; dollars = (int) totalChange; System.out.println(); System.out.println ("Your change is $" totalChange " which is ..."); System.out.println(dollars + " dollars"); System.out.println(); } }