I need help to set time on this c++ file please help me set datetime On doLogin, set current system datetime for login, month, day, year, hour, minute, second. On doLogout,  set current system datetime for login, month, day, year, hour, minute, second.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help to set time on this c++ file please help me set datetime

On doLogin, set current system datetime for login, month, day, year, hour, minute, second.

On doLogout,  set current system datetime for login, month, day, year, hour, minute, second.

 

HAN¦¦°5♥♥♥DSRINNKRFØRÅÒX⠀⠀⠀88-
55
56
57
59
60
61
62
63
64
65
66
67
68
69
70
72
73
74
75
71 bool LoginMenu::do Login() {
int attempt = 0;
do {
76
77
78
79
80
81
82
83
84
86
87
89
90
bool
}
}
LoginMenu::authenticate() {
bool valid = false;
for (int i = 0; i < (int) list.size(); i++) {
if (login.getUsername() list.at (i).getUsername() &&
login.getPassword() == list.at (i).getPassword()) {
int mo = 0, d = 0, yr = 0, hr = 0, min = 0, sec = 0;
getCurrentTime(mo, d, yr, hr, min, sec);
// TODO set loginDateTime
valid = true;
break;
}
}
}
return valid;
}
string username, password;
cout << "Username: ";
cin >> username;
cout << "Password: ";
cin >> password;
bool LoginMenu::create() {
login.setUsername (username);
login.setPassword (password);
// TODO Lab 3 - set login DateTime
cout << endl;
if (authenticate()) {
return true;
}
} while (++attempt < 3);
return false;
91
92
93 }
94
95 bool LoginMenu::remove() {
96
97
98
99
100 bool LoginMenu::reset() {
101
==
cout << "Todo create" << endl;
return true;
cout << "Todo Remove" << endl;
return true;
102
103 }
104
105 bool LoginMenu::doLogout () {
106
107
108
109
110
111
112
cout << "Todo Reset" << endl;
return true;
cout << "Todo Logout" << endl;
int mo = 0, d = 0, yr = 0, hr = 0, min = 0, sec = 0;
getCurrent Time (mo, d, yr, hr, min, sec);
// TODO set logoutDateTime
return true;
Transcribed Image Text:HAN¦¦°5♥♥♥DSRINNKRFØRÅÒX⠀⠀⠀88- 55 56 57 59 60 61 62 63 64 65 66 67 68 69 70 72 73 74 75 71 bool LoginMenu::do Login() { int attempt = 0; do { 76 77 78 79 80 81 82 83 84 86 87 89 90 bool } } LoginMenu::authenticate() { bool valid = false; for (int i = 0; i < (int) list.size(); i++) { if (login.getUsername() list.at (i).getUsername() && login.getPassword() == list.at (i).getPassword()) { int mo = 0, d = 0, yr = 0, hr = 0, min = 0, sec = 0; getCurrentTime(mo, d, yr, hr, min, sec); // TODO set loginDateTime valid = true; break; } } } return valid; } string username, password; cout << "Username: "; cin >> username; cout << "Password: "; cin >> password; bool LoginMenu::create() { login.setUsername (username); login.setPassword (password); // TODO Lab 3 - set login DateTime cout << endl; if (authenticate()) { return true; } } while (++attempt < 3); return false; 91 92 93 } 94 95 bool LoginMenu::remove() { 96 97 98 99 100 bool LoginMenu::reset() { 101 == cout << "Todo create" << endl; return true; cout << "Todo Remove" << endl; return true; 102 103 } 104 105 bool LoginMenu::doLogout () { 106 107 108 109 110 111 112 cout << "Todo Reset" << endl; return true; cout << "Todo Logout" << endl; int mo = 0, d = 0, yr = 0, hr = 0, min = 0, sec = 0; getCurrent Time (mo, d, yr, hr, min, sec); // TODO set logoutDateTime return true;
C* loginMenu > No Selection
1 #include <iostream>
2 #include <fstream>
3 #include <string>
4 #include <sstream>
5 #include "loginMenu.h"
6 #include "login.h"
7 #include "menu.h"
8 #include "dateTime.h"
9 #include "utils.h"
10
11
12
13 LoginMenu::LoginMenu()
14
15
16
17
18
DAN≈✿✿~✿~✿¦¦¦¦¦±¦¦¦¦¦G FIIFF÷+¶¶NNANHADO
19
20
21
22 }
23
25
26
27
24 void LoginMenu::initUserData() {
fstream inFile;
openFile(inFile, USERS_DATA);
// Placeholder variables for data in the file
string id;
string username;
string password;
string login DateTime;
string logout DateTime;
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
using namespace std;
57
58
: Menu ("Login Menu") {
addOption ("Login");
}
addOption("Create Account");
addOption ("Remove Account");
addOption ("Reset Password");
addOption("Exit");
initUserData();
string line = "";
while (getline (inFile, line)) {
stringstream ss(line);
}
getline (ss, id, ',');
getline (ss, username, ',');
password, '
getline (ss,
getline (ss,
getline (ss,
loginDateTime,
logoutDateTime,
inFile.close();
56 bool LoginMenu::authenticate() {
Login login;
login.setId (stoi(id));
login.setUsername (username);
login.setPassword (password);
login.setLoginDateTime (loginDateTime);
login.setLogout Date Time (logoutDateTime);
list.push_back(login);
');
bool valid = false;
for (int i = 0; i < (int) list.size(); i++) {
// convert from strong integer
// DateTime
// DateTime
Transcribed Image Text:C* loginMenu > No Selection 1 #include <iostream> 2 #include <fstream> 3 #include <string> 4 #include <sstream> 5 #include "loginMenu.h" 6 #include "login.h" 7 #include "menu.h" 8 #include "dateTime.h" 9 #include "utils.h" 10 11 12 13 LoginMenu::LoginMenu() 14 15 16 17 18 DAN≈✿✿~✿~✿¦¦¦¦¦±¦¦¦¦¦G FIIFF÷+¶¶NNANHADO 19 20 21 22 } 23 25 26 27 24 void LoginMenu::initUserData() { fstream inFile; openFile(inFile, USERS_DATA); // Placeholder variables for data in the file string id; string username; string password; string login DateTime; string logout DateTime; 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 using namespace std; 57 58 : Menu ("Login Menu") { addOption ("Login"); } addOption("Create Account"); addOption ("Remove Account"); addOption ("Reset Password"); addOption("Exit"); initUserData(); string line = ""; while (getline (inFile, line)) { stringstream ss(line); } getline (ss, id, ','); getline (ss, username, ','); password, ' getline (ss, getline (ss, getline (ss, loginDateTime, logoutDateTime, inFile.close(); 56 bool LoginMenu::authenticate() { Login login; login.setId (stoi(id)); login.setUsername (username); login.setPassword (password); login.setLoginDateTime (loginDateTime); login.setLogout Date Time (logoutDateTime); list.push_back(login); '); bool valid = false; for (int i = 0; i < (int) list.size(); i++) { // convert from strong integer // DateTime // DateTime
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education