Question: C++ Please Help Solve: Complete MakeWithdrawal()'s recursive case: If day is even, call MakeWithdrawal() to compute the next day's amount as the current day's amount

C++ Please Help Solve:

Complete MakeWithdrawal()'s recursive case:

If day is even, call MakeWithdrawal() to compute the next day's amount as the current day's amount minus 6.

Otherwise, call MakeWithdrawal() to compute the next day's amount as the current day's amount minus 16.

Ex: If the input is 3 310, then the output is:

Day: 3, amount: 288

Code:

#include using namespace std;

void MakeWithdrawal(int totalDay, int day, int amount) { if (day == totalDay) { cout << "Day: " << day << ", amount: " << amount << endl; } else { /* Your code goes here */ } }

int main() { int totalDay; int amount; cin >> totalDay; cin >> amount; MakeWithdrawal(totalDay, 1, amount); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!