Teachers.io
Lesson Details
Password Program Key
Academic Year 2018/19
Date
Dec. 13, 2018
Additional Info
#include <iostream>
#include <string>
using namespace std;
//global variables
string username, password;
int main(){
username="admin";
password="enterplease";
cout<<"Username: ";
cin>>username;
cout<<endl;
cout<<"Enter Password: ";
cin>>password;
cout<<endl;
if (username =="admin" && password == "enterplease"){
cout<<"Access Granted! \n";
}
else {
cout<<"Access Denied!";
}
return 0;
}//end of main....