Create a class Employee with following data members, name, id, and salary as private data member. Create array of objects for four employees, compare their salary using operator overloading, and display the records of the student who is getting less salary.
#include <iostream>
#include <fstream>
using namespace std;
int main() {
fstream fio;
string line;
fio.open("Text1.txt", ios::in);
if(!fio) {
cout << "No Such File";
}
else {
while (getline(fio, line)) {
cout << line << endl;
}
fio.close();
fio.open("Text1.txt", ios::app);
fio << "\nNow learnt C++;Java is my next target.";
fio.close();
return 0;
}
}
Comments
Leave a comment