Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How do I make this method print the actual coins used to make thechange. Please

ID: 3609621 • Letter: H

Question

How do I make this method print the actual coins used to make thechange.
Please help. I need to somehow modify this method to print theactual coins.

public static int changeByRecur(int[] coins,int change)
   {
       int minCoins=change;
       for(inti=0;i<coins.length;i++){
           if(coins[i]==change){
             
              return 1;
             
           }
       }
      
       for(intj=1;j<=change/2;j++){
           intthisCoins=changeByRecur(coins,j)
                      +changeByRecur(coins,change-j);
          
           if(thisCoins<minCoins)
           {
             
             
             
              minCoins=thisCoins;
           }
       }
       return minCoins;
      
      
   }

Explanation / Answer

please rate - thanks there has to be a better way, but I think this will work in main program declare your new arrays and counters System.out.println(changeByRecur(coins,change,denom,count,tempdenom,tempcount)); print denom[0] through denom[count-1]               public static intchangeByRecur(int[] coins,int change,int denom[],intcount,tempdenom[],int tempcount) //public static int changeByRecur(int[] coins,int change)    {        int minCoins=change;        for(inti=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote