HELP ME RUN THIS CODE... PLEASE Create a login and Registration System in c++ #include #include #include using namespace std; void login(); void registration(); void forgot(); int main() { int c; cout<<"\t\t\t\t-----------------------\n"; cout<<"\t\t\t\t| WELCOME TO |\n"; cout<<"\t\t\t\t-----------------------\n"; cout<<"\t\t\t\t*********MAIN MENU*****\n"; cout<<"\t\t\t----------------------------------------\n"; cout<<"\t\t\t|Pres 1 to Login |"<>c; cout<> userID; cout<<"\t\t\t Password"<>password; ifstream input ("records.txt"); while(input>>id>>pass) { if(id==userID && pass==password) { count=1; system("cls");}}    input.close();    if (count==1) { cout<>userID; cout<<"\t\t\t Enter the Password "<>password; ofstream f1 ("records.txt",ios::app); cout<>choice; switch(choice) { case 1: int count=0; string suserID, spass_word, sid, spass; cout<<" Enter the username which you remembered:"; cin>>suserID; ifstream f2 ("records.txt"); while(f2>>sid>>spass) { if(sid==suserID) count==1;} f2.close(); if(count==1){ cout<<"\n\n Your Account is Found\n"; cout<<"\n\n Your Password is:"<

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
100%

HELP ME RUN THIS CODE...

PLEASE

Create a login and Registration System in c++

#include <iostream>
#include <fstream>
#include <string.h>


using namespace std;

void login();
void registration();
void forgot();

int main()
{
int c;
cout<<"\t\t\t\t-----------------------\n";
cout<<"\t\t\t\t| WELCOME TO |\n";
cout<<"\t\t\t\t-----------------------\n";
cout<<"\t\t\t\t*********MAIN MENU*****\n";
cout<<"\t\t\t----------------------------------------\n";
cout<<"\t\t\t|Pres 1 to Login |"<<endl;
cout<<"\t\t\t|Pres 2 to Register |"<<endl;
cout<<"\t\t\t|Pres 3 If you forgot your password |"<<endl;
cout<<"\t\t\t|Pres 4 to Exit |"<<endl;
cout<<"\t\t\t----------------------------------------\n";
cout<<" \t\t\t\tEnter your Choice "<<endl;
cin>>c;
cout<<endl;
  
switch(c)
{
case 1: login();
break;
case 2: registration();
break;
case 3: forgot();
break;
case 4:
cout<<"\t\t\t Thank you!\n\n";
break;
  
default:
cout<<"\t\t\t Please Select From the Option Given Above\n\n";
}
  
main();
  
}

void login()
{
int count;
string userID, password, id, pass;
system("cls");
cout<<"\t\t\t Please Enter Username and Password"<<endl;
cout<<"\t\t\t Username"<<endl;
cin>> userID;
cout<<"\t\t\t Password"<<endl;
cin>>password;
ifstream input ("records.txt");
while(input>>id>>pass)
{
if(id==userID && pass==password)
{ count=1;
system("cls");}}
  
input.close();
  
if (count==1)
{
cout<<userID<<"Your Login is Successful\n Thank you for logging in!\n";

main ();
}
else{ cout<<"Login Error\n Please Check your username and password";}}

void registration()
{
string userID, password, id, pass;
system("cls");
cout<<"\t\t\t Enter the Username "<<endl;
cin>>userID;
cout<<"\t\t\t Enter the Password "<<endl;
cin>>password;
ofstream f1 ("records.txt",ios::app);
cout<<userID<<password<<endl;
system("cls");
cout<<"\t\tRegistration is Successful\n";
  
main();}
  
void forgot()
{
int choice;
system("cls");
cout<<"\t\t You Forgot Your Password? No Worries\n";
cout<<"\t\t Press 1 to search your id by username"<<endl;
cout<<"\t\t Press 2 to go back to the main menu"<<endl;
cout<<"\t\t Enter your choice";
cin>>choice;

switch(choice)
{
case 1:
int count=0;
string suserID, spass_word, sid, spass;
cout<<" Enter the username which you remembered:";
cin>>suserID;
ifstream f2 ("records.txt");
while(f2>>sid>>spass)
{
if(sid==suserID)

count==1;}

f2.close();
if(count==1){
cout<<"\n\n Your Account is Found\n";
cout<<"\n\n Your Password is:"<<spass;


main();
}
else{
cout<<"\n\t Sorry your Account is not found!\n";
main();
  
}
break;}

case 2:
{
  
main();
  
}
  
default:
cout<<"\t\t\t Wrong Choice! Please Try Again"<<endl;

forgot();

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Knowledge Booster
Reference Types in Function
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