#include <iostream>
#include <string>
#include <windows.h>
#include <time.h>
usingnamespace std;
int main();
string username = "Joey";
int password = 4433;
class TitleScreen{
public:
void Start(){
cout << "Welcome to the London Bank ATM.\n" << endl;
Sleep(2000);
cout << "Insert your card please.\n" << endl;
Login LoginObject;
LoginObject.Username();
}
private:
};
class Login{
public:
void Username(){
Sleep(4000);
cout << "Username: ";
cin >> username;
cout << "Password: ";
cin >> password;
}
private:
};
int main()
{
TitleScreen TitleScreenObject;
TitleScreenObject.Start();
}
C:\Users\Kodning\Desktop\C++ Projects\Bank ATM 2.0\main.cpp: In member function 'void TitleScreen::Start()':
C:\Users\Kodning\Desktop\C++ Projects\Bank ATM 2.0\main.cpp:20:13: error: 'Login' was not declared in this scope
C:\Users\Kodning\Desktop\C++ Projects\Bank ATM 2.0\main.cpp:20:19: error: expected ';' before 'LoginObject'
C:\Users\Kodning\Desktop\C++ Projects\Bank ATM 2.0\main.cpp:21:13: error: 'LoginObject' was not declared in this scope
You need to declare the Login object before the titlescreen object. as it stands right now the titlescreen object doesn't know that the Login object exists.