Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////class.h
- #pragma once
- #include <iostream>
- #include <fstream>
- using namespace std;
- class task_manager
- {
- string describe;
- string name;
- string id;
- string day;
- string month;
- string year;
- string time;
- bool finished;
- public:
- void deleteTask(int i);
- void AddTask(string name, string describe, string day, string month, string year, string time);
- bool submit();
- void search();
- void read();
- void update();
- task_manager();
- ~task_manager();
- };
- ////////class.cpp
- #include "task_manager.h"
- #include <fstream>
- #include <queue>
- #include <string>
- void task_manager::AddTask(string name, string describe, string day, string month, string year, string time) {
- queue<string> task;
- string input; char choice = 'y'; int counter = 0;
- while (choice == 'y') {
- cout << "Enter task: ";
- cin >> name;
- task.push(name);
- counter++;
- cin >> describe;
- task.push(describe);
- counter++;
- cin >> day;
- task.push(day);
- counter++;
- cin >> month;
- task.push(month);
- counter++;
- cin >> year;
- task.push(year);
- counter++;
- cin >> time;
- task.push(time);
- counter++;
- task.push("0@");
- counter++;
- cout << "more? " << endl;
- cin >> choice;
- }
- ofstream write;
- write.open("C:/New Folder/information.txt", write.app);
- for (int i = 0; i < counter; i++) {
- if (task.front() == "0@") { //end of each task
- write << task.front() << endl;
- task.pop();
- }
- write << task.front() <<" "; //'*';
- task.pop();
- }
- write.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement