The piggy bank starts empty and gets 15 every week, until it holds 100. Show how many weeks that takes. The saving line is written — only the week count is missing.
7
#include <iostream>
using namespace std;
int main() {
int saved = 0;
int weeks = 0;
while (saved < 100) {
saved += 15;
// your code here: add one to the number of weeks
}
cout << weeks << endl;
return 0;
}
Run tries the examples. When they look right, Submit.