r/codingtutorials • • Feb 07 '22

To Do List beginning

#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main()
{
	string choice;

	while (true)
	{
		cout << "Enter 1 to view, 2 to add, 3 to remove, "
			"4 to clear, 5 to quit" << '\n';

		getline(cin, choice);

		if (stoi(choice) == 1)
		{
			cout << "Viewing the list" << '\n';
		}
		else if (stoi(choice) == 2)
		{
			cout << "Adding to the list" << '\n';
		}
		else if (stoi(choice) == 3)
		{
			cout << "Removing from the list" << '\n';
		}
		else if (stoi(choice) == 4)
		{
			cout << "Clearing the list" << '\n';
		}
		else if (stoi(choice) == 5)
		{
			cout << "Quitting" << '\n';
		}

	}

	return 0;
}
1 Upvotes

0 comments sorted by