The café gives you a stamp on your card every visit. Write add_stamp(stamps) to add 1 to stamps. The parameter is a reference, int &, so the card outside changes too. stamps_after is already written and uses your add_stamp.
stamps_after(3, 2)→5stamps_after(0, 0)→0int stamps_after(int start, int visits)#include <iostream>
using namespace std;
void add_stamp(int &stamps) {
// your code here: add 1 to stamps
}
int stamps_after(int start, int visits) {
int card = start;
for (int i = 0; i < visits; i++) {
add_stamp(card);
}
return card;
}
Run tries the examples. When they look right, Submit.