Question: java program I want it to calculate change Need a little help to finish the program Still struggling if someone could explain what I did

java program

I want it to calculate change

Need a little help to finish the program

Still struggling if someone could explain what I did wroing and give me pointers. please try to explain to me as much as possible.

{ int dollar; // defines dollar and double is more percise and able to use decimals int amount; // defines amount of change put in double cents; // defines amount of change given back int d = 0.25; // deifines quarter amount int m = 0.10; // defines dime amount int n = 0.05; // deifines nickel amount int p = 0.1; // defines penny amount System.out.println("Enter the change amount"); double dollar = scan.nextDouble(); // returns the value of the dollar double dollar = scan.nextDouble(); // returns the value of the dollar double amount = dollars - cents; // subtracts change from dollar if ( amount =< 0.25) // needs identifier System.out.println("Quarters: " + quarters); else if ( amount == 0.25) System.out.println("Quarter: " + quarter); if amount if ( amount =< 0.10) System.out.println("Dimes: " + dimes); else if ( amount == 0.10) System.out.println("Dime: " + dime); else if ( amount =< 0.5) System.out.println("Nickels: " + nickels); if ( amount == 0.5) System.out.println("Nickel: " + nickel); if ( amount =< 0.1) System.out.println("Pennies: " + pennies); if ( amount == 0.1) System.out.println("Penny: " + penny);

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!