C++ recursive function

Programming

Question Description

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
This is great! Exactly what I wanted.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4