#include #include #include #include using namespace std; using json = nlohmann::json; int main() { const string filename = "tasks.json"; bool filexists; filexists = filesystem::exists(filename); if (filexists == 1) { int choice; cout << "1. Add Task" << endl; cout << "2. Tick Task" << endl; cout << "3. Remove Task" << endl; cin >> choice; switch (choice) { case 1: cout << "invoke func 1" << endl; break; case 2: cout << "invoke func 2" << endl; break; case 3: cout << "invoke func 3" << endl; break; default: cout << "invalid input" << endl; } } else { cout << "File not found, restart program!" << endl; ofstream Newfile(filename); } system("pause > 0"); return 0; } void addTask() { ifstream file("tasks.json"); json tasks; file >> tasks; string taskName; cout << "Enter Task Name: " << endl; getline(cin, taskName); tasks["alltasks"]["pending tasks"].push_back(taskName); }