Determine the minimum number of coins for change Given any number between 1 and 99, determine how to give change with the minimum number of coins. You can assume that the coins are 1c, 2c, 5c, 10c, 20c and 50c.

Source Code : 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class 
ChangeCalculator {

    
/**
     * @param args
     */
    
public static void main(String[] args) {
        
/*Scanner scn = new Scanner(System.in);
        Integer amount = scn.nextInt();*/
        
Integer amount 105;
        
Map<StringIntegerchangeMap getChange(amount);
        
System.out.println(changeMap);

    }
    
    private static 
Map<StringIntegergetChange(Integer amount) {
        
Map<StringIntegerchangeMap = new HashMap<StringInteger>();
        List<
IntegerchangeList = new ArrayList<Integer>();
        
changeList.add(50);
        
changeList.add(20);
        
changeList.add(10);
        
changeList.add(5);
        
changeList.add(2);
        
changeList.add(1);
        
Integer remAmt amount;

[Login or Register to remove this advertisement]

        for (
Integer change changeList) {
            
Integer changeCount = (remAmt change);
            
changeMap.put(change+"c"changeCount);
            
remAmt remAmt - (changeCount*change);
        }
        return 
changeMap;
    }
    
    
//private static


Xcode Reviewed by Xcode on . Determine the minimum number of coins for change Determine the minimum number of coins for change Given any number between 1 and 99, determine how to give change with the minimum number of coins. You can assume that the coins are 1c, 2c, 5c, 10c, 20c and 50c. import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class ChangeCalculator { /** Rating: 5