I am just starting to teach myself C++ and set a little task to input 6 employees and their wagerates and hours worked and then output their total wages plus split them down into the notes and coins needed to pay them.

Would it be asking too much to ask one of the more experienced among you to have a quick look at the result and then criticise constructively taking into account I have not put any error checking in as yet but I just want to know I am on the right track regarding layout and indenting and maybe logic as well before I delve deeper.

Thanks in advance.

Code:#include <windows.h> #include <iostream> #include <string> #include <vector> #include "ShortColours.h" #include <iomanip> using namespace std; int main() { int fiftyp [7]; int twentyp [7]; int tenp [7]; int fivep [7]; int twop [7]; int onep [7]; int fiftyd [7]; int twentyd [7]; int tend [7]; int fived [7]; int twod [7]; int oned [7]; string employee [7]; float payrate [7]; float hoursworked [7]; float totalpay [7]; HANDLE hOut; hOut=GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute (hOut, BWI | FBI); for (int x(1); x<7; x++) { cout<<"Employee name : "; cin>>employee[x]; cout<<"Payrate : œ"; cin>>payrate[x]; cout<<"Hours worked : "; cin>>hoursworked[x]; totalpay[x]=payrate[x] * hoursworked[x]; cout<<endl; SetConsoleTextAttribute (hOut, BBI | FWI); cout<<"Employee No "<<x<<endl; cout<<"Employee : "<<employee[x]<<endl; cout<<"Payrate : œ"<<payrate[x]<<endl; cout<<"Hours : "<<hoursworked[x]<<endl; cout<<"Total Pay : œ" <<totalpay[x]<<endl<<endl<<endl<<endl; } for (int x(1); x<7; x++) { cout<<"Change required for "<<employee[x]<<endl; cout<<" œ50"<<setw(6)<<" œ20"<<setw(6)<<" œ10"<<setw(6)<<" œ5"<<setw(6)<<" œ2"; cout<<setw(6)<<" œ1"<<setw(6)<<" 50p"<<setw(6)<<" 20p"<<setw(6)<<" 10p"<<setw(6); cout<<" 5p"<<setw(6)<<" 2p"<<setw(6)<<" 1p"<<setw(6)<<endl; float divide=totalpay[x]*100; fiftyp[x]=divide/5000;divide=divide-(fiftyp[x]*5000); twentyp[x]=divide/2000;divide=divide-(twentyp[x]*2000); tenp[x]=divide/1000;divide=divide-(tenp[x]*1000); fivep[x]=divide/500;divide=divide-(fivep[x]*500); twop[x]=divide/200;divide=divide-(twop[x]*200); onep[x]=divide/100;divide=divide-(onep[x]*100); fiftyd[x]=divide/50;divide=divide-(fiftyd[x]*50); twentyd[x]=divide/20;divide=divide-(twentyd[x]*20); tend[x]=divide/10;divide=divide-(tend[x]*10); fived[x]=divide/5;divide=divide-(fived[x]*5); twod[x]=divide/2;divide=divide-(twod[x]*2); oned[x]=divide/1;divide=divide-(oned[x]*1); cout<<setw(4)<<fiftyp[x]<<setw(6)<<twentyp[x]<<setw(6)<<tenp[x]<<setw(6)<<fivep[x]<<setw(6); cout<<twop[x]<<setw(6)<<onep[x]<<setw(6)<<fiftyd[x]<<setw(6)<<twentyd[x]<<setw(6)<<tend[x]; cout<<setw(6)<<fived[x]<<setw(6)<<twod[x]<<setw(6)<<oned[x]<<setw(6)<<endl<<endl<<endl<<endl; } SetConsoleTextAttribute (hOut, BWI | FRI); cout<<"Total change required for all employees :"<<endl; cout<<" œ50"<<setw(6)<<" œ20"<<setw(6)<<" œ10"<<setw(6)<<" œ5"<<setw(6)<<" œ2"; cout<<setw(6)<<" œ1"<<setw(6)<<" 50p"<<setw(6)<<" 20p"<<setw(6)<<" 10p"<<setw(6); cout<<" 5p"<<setw(6)<<" 2p"<<setw(6)<<" 1p"<<setw(6)<<endl; int t50p=fiftyp[1]+fiftyp[2]+fiftyp[3]+fiftyp[4]+fiftyp[5]+fiftyp[6]; int t20p=twentyp[1]+twentyp[2]+twentyp[3]+twentyp[4]+twentyp[5]+twentyp[6]; int t10p=tenp[1]+tenp[2]+tenp[3]+tenp[4]+tenp[5]+tenp[6]; int t5p=fivep[1]+fivep[2]+fivep[3]+fivep[4]+fivep[5]+fivep[6]; int t2p=twop[1]+twop[2]+twop[3]+twop[4]+twop[5]+twop[6]; int t1p=onep[1]+onep[2]+onep[3]+onep[4]+onep[5]+onep[6]; int t50d=fiftyd[1]+fiftyd[2]+fiftyd[3]+fiftyd[4]+fiftyd[5]+fiftyd[6]; int t20d=twentyd[1]+twentyd[2]+twentyd[3]+twentyd[4]+twentyd[5]+twentyd[6]; int t10d=tend[1]+tend[2]+tend[3]+tend[4]+tend[5]+tend[6]; int t5d=fived[1]+fived[2]+fived[3]+fived[4]+fived[5]+fived[6]; int t2d=twod[1]+twod[2]+twod[3]+twod[4]+twod[5]+twod[6]; int t1d=oned[1]+oned[2]+oned[3]+oned[4]+oned[5]+oned[6]; cout<<setw(4)<<t50p<<setw(6)<<t20p<<setw(6)<<t10p<<setw(6)<<t5p<<setw(6)<<t2p<<setw(6); cout<<t1p<<setw(6)<<t50d<<setw(6)<<t20d<<setw(6)<<t10d<<setw(6)<<t5d<<setw(6)<<t2d; cout<<setw(6)<<t1d<<setw(6)<<endl<<endl; cout<<endl<<endl; SetConsoleTextAttribute (hOut, BRI); cout <<" "; SetConsoleTextAttribute (hOut, BWI); cout <<" "; SetConsoleTextAttribute (hOut, FWI | BBI); cout<<" Thanks for using this fantastic C++ program from JaySoft "; SetConsoleTextAttribute (hOut, BYI); cout <<" "; SetConsoleTextAttribute (hOut, FWI | BBI); cout<<" Just press <enter> to exit "; SetConsoleTextAttribute (hOut, BWI); cout <<" "; SetConsoleTextAttribute (hOut, BRI); cout <<" "; return 0; }