Activity Planner Program

I'm pretty new to c++. I've taken a couple of classes and I'm currently working on a program that lets the user input a list of activities for the day, and then check off each completed activity.

The user enters a number corresponding to the number of the activity to be checked off. If an activity has been completed, then it an "x" will be marked next to the activity.

I am able to check off each item one at a time, but I can't seem to check off multiple items.

What am I doing wrong? Or rather, what can I do differently? Thank you.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include<iostream>
#include<string>
using namespace std;

int main(){
	string input[100];
	int count = 0;
	int num[100];
	int temp = 0;
	int totalItems = 0;
	int check[100];

	cout << "Enter activities for the day. " <<
		"Type 'done' when you are finished: " << endl;

	for (count = 0; count < 100; count++) {    

		cin >> input[count];    // the user inputs a list of activities and types "done" all desired activities are listed

		if (input[count] == "done") {
				
			totalItems = count;
			system("CLS");
			cout << totalItems << " items entered. " << endl;
			cout << "Alright, what have you completed?: " << endl;
			for (count = 0; count < totalItems; count++) {
				cout << input[count] << endl;
			}
				
			for (int y = 0; y < 100; y++) {    // loop that allows the user to enter the number corresponding to the activity that they have completed

				cin >> num[y];
				
				temp = num[y] - 1;
				
				system("CLS");
				cout << totalItems << " items entered. " << endl;
				cout << "Alright, what have you completed?: " << endl;

				for (count = 0; count < totalItems; count++) {

					if (count != temp) {      
						cout << input[count] << endl;
					}
					else if ((temp = count)) {     // when the input number matches the current count, the activity will show and "x" next to it.
							
						cout << input[temp] << " x" << endl;

						check[count] = 1;
					}
					else if (num[count] = 1) {    // if an activity has already been completed (checked), then the "x" will remain next to it.
						cout << input[temp] << " x" << endl;
					}
				}
			}
		}
	}
	system("PAUSE");

}
@cupcake007

You have single '=' where a double '==' should be. Lines 45 and 51. Also, you should use a do/while loop starting at line 16. I'm not sure of what some of your code is to accomplish, so I streamlined it a bit. Is this what you're trying to do??
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string input[100];
	int count = 0;
	int num[100];
	int temp = 0;
	int totalItems = 0;
	int check[100];

	cout << "Enter activities for the day. " << endl <<
		"Type 'done' when you are finished: " << endl;

	do{    

		cin >> input[count];    // the user inputs a list of activities and types "done" all desired activities are listed

		if (input[count] == "done")
		{

			totalItems = count;
			system("CLS");
			cout << totalItems << " items entered. " << endl;
			cout << "They are: " << endl;
			for (count = 0; count < totalItems; count++)
			{
				cout << count + 1 << " : " << input[count] << endl;
			}
		}
		else
			count++;
	}while(count < 100 && input[count] != "done");

	for (int y = 0; y < totalItems; y++) // loop that allows the user to enter the number corresponding to the activity that they have completed
	{    

		cout << "Did you finish [ " << input[y] << " ] - ( Enter '1' for 'YES', or '0', for 'NO' )" << endl; 
		cin >> num[y];
	}

		//temp = num[y];

		system("CLS");
		cout << totalItems << " items entered. " << endl;
		cout << "Alright, what have you completed?: " << endl;

		for (count = 0; count < totalItems; count++) {

			if (num[count] == 0) {      
				cout << input[count] << endl;
			}
			else if (num[count] == 1)  // when the input number matches the current count, the activity will show and "x" next to it.
			{    

				cout << input[count] << " x" << endl;
			}
		}
	
	cin >> temp; // Just to prevent screen from closing
}
This helps very much. Thanks! ^_^
Topic archived. No new replies allowed.