Requirements: We are going to write a program that will imitate standard feature
ID: 3545213 • Letter: R
Question
Requirements: We are going to write a program that will imitate standard features of a website authentication procedures.
1- First screen that will be displayed to the user should ask a question about the action to be performed. The user should be able to:
a. Sign Up for the system
b. Log In to the system
c. Exit the system
2- Once the user is taken to the sign up page you should be asking several questions to the user. Password should be at least 8 characters long and must include at least one uppercase letter, one lowercase letter and one digit.
a. First Name
b. Last Name
c. Username
d. Password
e. Password (verification)
3- Once the passwords match, user should be recorded into a structure that contains the
information about the users.
4- Log in page should ask for a valid username and password.
a. If there is no such username, the user should be informed and should be able to
reenter a username.
b. If there is such a username then password should be asked. If the usernamepassword
pair matches then the user should receive a greeting message with
his/her first name and last name. If the user types the wrong password, a message
should warn the user and give another opportunity to enter the password. If the
user enters a wrong password thrice then the username should be disabled and the
user should be taken to the main screen.
5- Once the user logs in, he/she should be able to change and enter personal information. The user
should be able to change first name and last name. Also the user should be able to enter Address,
e-mail and phone information at this stage.
BONUS: (+20 points)
Added security
Explanation / Answer
#include <iostream>
#include <string>
using namespace std;
void breakNames(string name, int &index);
void outputNames(string name, int index);
int main()
{
string name;
string username;
string keerthana ;
username =keerthana;
int index;
int password;
password = 1234
cout << "This program will take your full name, and separate them into your first, middle, and last name,"
<< "and then print out the length of them each. " << endl;
cout <<" Enter your full name." << endl;
getline(cin, name);
breakNames(name, index);
outputNames(name, index);
system("pause");
return 0;
}
void breakNames(string name, int &index)
{
index = name.find(' ');
cout << "First Name: " << name.substr(0, index) << endl;
name = name.substr(index+1, name.length()-1);
index = name.find(' ');
cout << "Middle Name: " << name.substr(0, index) << endl;
name = name.substr(index+1, name.length()-1);
cout << "Last Name: " << name << endl;
}
void outputNames(string name, int index)
{
cout << "The first name's length is: " << name.length() << endl;
cout << "The middle name's length is: " << name.length() << endl;
cout << "The last name's length is: " << name.length() << endl;
cout << "Enter username:";
cin >> keerthana;
cout <<" ";
cout << "Enter password:";
cin >> password;
cout <<" ";
}
if (password == 1234)
cout << "Access Granted...";
if (password != 1234)
cout << "Access Denied.....Invalid Username/Password:";
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.