So, will first log in, then I will chose Employees, but it always gives me payroll. I don't know if I messed up code-wise or it's just the stupid Online IDE I'm using. Well, here it is...
#include <iostream>
#include <string>
#ifndef en
#define en std::endl
#endif
using namespace std;
void login() {
//Basic login program
string correctPass = "Love";
string attemptPass;
cout << "Please insert password" << en;
cin >> attemptPass;
if (attemptPass == correctPass) {
cout << "Access Granted" << en << en;
} else {
login();
}
}
void mainMenu() {
void employees();
void payroll();
cout << en << "MAIN MENU" << en << en << "Payroll" << en << "Employees" << en << en;
string mainMenuOption;
cin >> mainMenuOption;
if (mainMenuOption == "Payroll" || "payroll") {
payroll(); }
else if (mainMenuOption == "Employees" || "employees") {
employees(); }
else {
mainMenu(); }
}
void payroll(){
cout << en << "WELCOME TO PAYROLL" << en << "-----------------" << en << "fish" << en;
}
void employees(){
cout << en << "WELCOME TO EMPLOYEES" << en << "-----------------" << en << "eleven" << en;
}
int main() {
login();
mainMenu();
return 0;
}
If anyone know's how I messed up please tell! Thanks!