-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeedback.cpp
67 lines (57 loc) · 1.78 KB
/
feedback.cpp
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
65
66
67
// #include <iostream>
// #include <fstream>
// #include <string>
// #include <ctime>
// #include <iomanip>
// using namespace std;
// class FeedbackSystem
// {
// public:
// void collectFeedback();
// void saveFeedback(const string& name, const string& email, const string& feedback);
// private:
// string getCurrentTime() const;
// };
// void FeedbackSystem::collectFeedback()
// {
// string name, email, feedback;
// cout << "=============== USER FEEDBACK INTERFACE ===============" << endl;
// cout << "Enter your name: ";
// getline(cin, name);
// cout << "Enter your email: ";
// getline(cin, email);
// cout << "Enter your feedback: ";
// getline(cin, feedback);
// saveFeedback(name, email, feedback);
// cout << "Thank you for your feedback!" << endl;
// }
// void FeedbackSystem::saveFeedback(const string& name, const string& email, const string& feedback)
// {
// ofstream file("feedback.txt", ios::app);
// if (!file)
// {
// cerr << "Error opening feedback file for writing!" << endl;
// return;
// }
// file << "=============== FEEDBACK ENTRY ===============" << endl;
// file << "Name: " << name << endl;
// file << "Email: " << email << endl;
// file << "Date: " << getCurrentTime() << endl;
// file << "Feedback: " << feedback << endl;
// file << "==============================================" << endl;
// file.close();
// }
// string FeedbackSystem::getCurrentTime() const
// {
// time_t now = time(0);
// tm *ltm = localtime(&now);
// char buffer[50];
// strftime(buffer, 50, "%Y-%m-%d %H:%M:%S", ltm);
// return string(buffer);
// }
// int main()
// {
// FeedbackSystem feedbackSystem;
// feedbackSystem.collectFeedback();
// return 0;
// }