repl.it
@ArlanPereira/

Designning flowchart

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <string>
using namespace std;

int main() {
  cout <<"--------- Begin Program --------- " << endl;
//declare variables to store the storeUserName and userNameEntered
  string storedUserName = "Boris";
  string userNameEntered;
//display message to the user.
  cout << "Enter your username: " << endl;
//get the user's input and assign it to the userNameEntered variables
  cin >> userNameEntered;
//compare the entered username with the stored username
  if(userNameEntered == storedUserName){
    //if they match
    cout << "Login Successful" << endl;
  }else{
    //if they don't match
    cout << "USername incorrect. Try again." << endl;
  }
  cout << "----------End Of Program----------";
}