Output aligned columns

In the class employee of print employee method:
Use this line to print.

cout << setw(20) << left << surname << setw(10) << left << empNumber << setw(4) << hourlyRate << endl;

You forgot to add “<< left“. This is required if you want left aligned.

Hope it ll useful.

Leave a Comment