Question #180154

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. 


Expert's answer

#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;
  
}
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS