"Do your homework" assignment
PrestonHong (0)

I cannot seem to figure out how to use a count controlled loop to display a reminder to "do your homework" 'x' number of times prompted by the user.
#include <iostream>
using namespace std;

int main ()
{
int reminder;
int initial = 1;
cout << "How many times would you like to be reminded to do your homework? ";
cin >> reminder;

	while (initial <= reminder)
	{
		cout << "Do your homework!" << endl;
	}
system("pause");
return 0;
You are viewing a single comment. View All
Giothecoder (2)

Or you could just use a for loop:

int main(){
cout << "how many times would you like to be reminded?\n";
int reminder;
cin >> reminder;
for( int count = 0; count < reminder; count++){
cout << "# " << count + 1 << ": ";
cout << "do your homework!\n";
}
}