Respuesta :
I guess, you ned it on Java. Check this code. I hope you'll find it helpful:
public class TRY{
public static void main(String[] args) {
double MONEY, QUARTERS, DIMES, NICKELS, PENNIES;
int DOLLAR_100, DOLLAR_50, DOLLAR_20, DOLLAR_10, DOLLAR_5, DOLLAR_1;
Scanner Scan = new Scanner(System.in);
System.out.print("Enter the monetary amount in xx.xx: " );
MONEY = Scan.nextFloat();
DOLLAR_100 = (int) (MONEY / 100);
DOLLAR_50 = (int) (MONEY % 100 / 50);
DOLLAR_20 = (int) (MONEY % 100 % 50 / 20);
DOLLAR_10 = (int) (MONEY % 100 % 50 % 20 / 10);
DOLLAR_5 = (int) (MONEY % 100 % 50 % 20 % 10 / 5);
DOLLAR_1 = (int) (MONEY % 100 % 50 % 20 % 10 % 5);
QUARTERS = Math.round( (MONEY % 100 % 50 % 20 % 10 % 5 % 1 / 0.25));
DIMES = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 / 0.10));
NICKELS = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 % 0.10 / .05));
PENNIES = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 % 0.10
% .05 / .01));
System.out.println(DOLLAR_100 + " hundred dollar bills" );
System.out.println(DOLLAR_50 + " fifty dollar bills" );
System.out.println(DOLLAR_20 + " twenty dollar bills" );
System.out.println(DOLLAR_10 + " ten dollar bills" );
System.out.println(DOLLAR_5 + " five dollar bills" );
System.out.println(DOLLAR_1 + " one dollar bills" );
System.out.println((int) QUARTERS + " quarters" );
System.out.println((int) DIMES + " dimes" );
System.out.println((int) NICKELS + " nickels" );
System.out.println((int) PENNIES + " pennies" );
System.out.println("Money left after % by 100: " + MONEY % 100);
}
}
public class TRY{
public static void main(String[] args) {
double MONEY, QUARTERS, DIMES, NICKELS, PENNIES;
int DOLLAR_100, DOLLAR_50, DOLLAR_20, DOLLAR_10, DOLLAR_5, DOLLAR_1;
Scanner Scan = new Scanner(System.in);
System.out.print("Enter the monetary amount in xx.xx: " );
MONEY = Scan.nextFloat();
DOLLAR_100 = (int) (MONEY / 100);
DOLLAR_50 = (int) (MONEY % 100 / 50);
DOLLAR_20 = (int) (MONEY % 100 % 50 / 20);
DOLLAR_10 = (int) (MONEY % 100 % 50 % 20 / 10);
DOLLAR_5 = (int) (MONEY % 100 % 50 % 20 % 10 / 5);
DOLLAR_1 = (int) (MONEY % 100 % 50 % 20 % 10 % 5);
QUARTERS = Math.round( (MONEY % 100 % 50 % 20 % 10 % 5 % 1 / 0.25));
DIMES = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 / 0.10));
NICKELS = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 % 0.10 / .05));
PENNIES = Math.round((MONEY % 100 % 50 % 20 % 10 % 5 % 1 % 0.25 % 0.10
% .05 / .01));
System.out.println(DOLLAR_100 + " hundred dollar bills" );
System.out.println(DOLLAR_50 + " fifty dollar bills" );
System.out.println(DOLLAR_20 + " twenty dollar bills" );
System.out.println(DOLLAR_10 + " ten dollar bills" );
System.out.println(DOLLAR_5 + " five dollar bills" );
System.out.println(DOLLAR_1 + " one dollar bills" );
System.out.println((int) QUARTERS + " quarters" );
System.out.println((int) DIMES + " dimes" );
System.out.println((int) NICKELS + " nickels" );
System.out.println((int) PENNIES + " pennies" );
System.out.println("Money left after % by 100: " + MONEY % 100);
}
}