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
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
Get step-by-step solutions from verified subject matter experts
