#include <iostream> using namespace std; class changeMaker{ public: int changeMa
ID: 3616766 • Letter: #
Question
#include <iostream>
using namespace std;
class changeMaker{
public:
int changeMake(int amount, int n){
if(amount==0){
return 1;
}
if(n==1){
return 1;
}
if(amount<0){
return 0;
}
if (n==0){
return 0;
}
else
return changeMake(amount, n-1)+changeMake(amount-coins[n], n);//Recursive function
}
};
int main(){
double f;
cout<<"Enter Dollar Amount ";
cin>>f;
cout<<" The amount entered is "<<f;
changeMaker.changeMake(); [i keep gettingerrors on this line]
cout<<" ";
}
Explanation / Answer
please rate - thanks you have to declare an objeck of type changeMake #include #include using namespace std; class changeMaker{ public: int changeMake(int amount, int n){ const int coins[]={1,5,10,15}; //Base Cases if(amount==0){ return 1; } if(n==1){ return 1; } if(amountRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.