-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignup.cpp
More file actions
44 lines (41 loc) · 1.29 KB
/
Signup.cpp
File metadata and controls
44 lines (41 loc) · 1.29 KB
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
#include <iostream>
#include <string>
using namespace std;
int main () {
string username, inputUsername, password, inputPassword, confirmPassword, name, qualification, number;
//Sign Up
cout << "**********Sign Up**********" << endl;
cout << "Enter Username: ";
cin >> username;
cout << "Enter Password: ";
cin >> password;
cout << "Enter Password again to confirm: ";
cin >> confirmPassword;
if (password == confirmPassword) {
cin.ignore(); //used here to ignore characters from input buffer
cout << "Enter Full Name: ";
getline(cin, name);
cout << "Enter Qualification: ";
getline(cin, qualification);
cout << "Enter Contact Number: ";
cin >> number;
//Sign In
cout << "\n\n**********Sign In**********" << endl;
cout << "Enter Username: ";
cin >> inputUsername;
cout << "Enter Password: ";
cin >> inputPassword;
if (password == inputPassword && username == inputUsername) {
cout << "\n\nLogin Successful! Welcome " << username << endl;
cout << "\n\n*********User Details*********" << endl;
cout << "Name: " << name << endl;
cout << "Qualification: " << qualification << endl;
cout << "Contact Number: " << number << endl;
} else {
cout << "\n\nIncorrect Username or Password, Try Again";
}
} else {
cout << "Password does not match.";
}
return 0;
}