How to combine and run thia two program
#include <iostream>
#include <string>
using namespace std;
int main(){
string username = "";
string password = "";
bool logInSuccess = false;
cout<<"\n Welcome! Please Log In below.\n\n";
do{
cout<<"Username: ";
cin>>username;
cout<<"Password: ";
cin>>password;
if(username == "Hadif" && password == "Syantik"){
cout<<"Sucessful Log In\n\n";
}
else{
cout<<"Incorrect username and password /n";
cout<<"Please try to Log In again.";
}
}while(logInSuccess);
system("pause");
return 0;
}
#include <iostream>
#include <cstring>
#include <ctime>
using namespace std;
void displayTime()
{
system ("cls");
time_t today=time(0);
char*date=ctime(&today);
cout <<date;
}
int main ()
{
int totalStudent, loc, counter = 0, studentID;
char lectName[30], studentName[30], program[30],lectID[30];
displayTime ();
cout << endl;
cout << "Please enter your name (Lecturer) : " ;
cin >> lectName;
cin.getline(lectName,30);
cout << "\nPlease enter the course code : " ;
cin >> program;
cin.getline(program,30);
cout << "\nPlease enter your id (Lecturer) : " ;
cin >> lectID;
cin.getline(lectID,30);
cout << "\nPlease enter the total number of student : " ;
cin >> totalStudent;
cout << endl;
while (counter < totalStudent )
{
cout << "\nStudent : " << counter+1 << endl;
cout << "\nFull name : " ;
cin >> studentName;
cin.getline(studentName,30);
cout << "\nID : " ;
cin >> studentID;
counter++;
if((strcmp(studentName,"-")==0) && (studentID == '-'))
counter--;
}
loc = counter;
cout << lectName<< endl;
cout << lectID << endl;
cout << program << endl << endl;
cout << "Total student in class (" << loc << "/" << totalStudent << ")";
system("pause");
}