/*
* This program will calculate the amount of coins
* needed for a specific amount of change using modulus
* mathematical operators and simple int conversions.
*/
class Main {
public static void main(String[] args) {
// 31.20 paid for with $35
//CREATE VARIABLES
int total = 3120;
int paid = 3500;
int change = paid - total;
double howMany=0.0;
//DECLARE COIN VALUES
// these are multiplied by 100 to remove decimal and turn to cents
int toonie, loonie, quarter, dime, nickel;
toonie = 200;
loonie = 100;
quarter = 25;
dime = 10;
nickel = 5;
howMany = change/toonie;
System.out.println(howMany + " toonies"); //calculate how many toonies will be given back
change = change%toonie; //use modulus for remainder
System.out.println(change + "left"); //display how much change is left (just needed for testing)
}
}