Hello, I've been working at this code from a couple angles, I've had two people I've known to help me, but even with their help it hasn't worked.
The question I have relates to CodeLab:
Write the definition of a function named printStarBucks that receives a non-negative integer n and prints a line consisting of N asterisks followed by N dollars signs. So, if the function received 5 it would print:
*****$$$$$
and if received 3 it would print ***$$$
The function must not use a loop of any kind (for, while, do-while) to accomplish its job. The function should invoke printStars to accomplish the task of printing a single line.
I've tried:
void printStarBucks (int n){
printStars(n);
printBucks(n);
}
void printStars (int n){
if (n > 0){
cout << "*";
printStars (n-1);
}
}
void printBucks(int n){
if (n > 0){
cout << "$";
printBucks(n-1);
}
}
As well as:
void printStarBucks(int n){
if(n>0){
printStars(N);
}
}
void printStars (int N){
cout << "*";
prtinStarBucks (n-1);
cout << "$";
}