Programming
C++ recursive function

Question Description

I’m studying for my Programming class and need an explanation.

how would I write these functions recursively in c++

int account::findAccount(int acctNumber, account accts[MAX], int count)

{

for (int i = 0; i < count; i++)

{

if (accts[i].acctNumber == acctNumber)

return i;

}

return -1;

}


And this function as well

void account::displayAll(account accts[MAX], int count)

{

for (int i = 0; i < count; i++)

{

accts[i].displayAccount();

cout << endl;

}

}

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

University of Virginia

Anonymous
Thanks for the help.

Anonymous
Outstanding. Studypool always delivers quality work.

Anonymous
Tutor was very helpful and took the time to explain concepts to me. Very responsive, managed to get replies within the hour.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4