Adding Company Name/Header

Here's my payroll program I am making which represents the company I work for. I as able to create it using arrays but now I want to add my company name at the top so when it's executed it shows.....How is this done? I've tried a few things but they are not working:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<iostream.h>
#include<iomanip.h>
main(){
       char empid[100][12];
       char fname[100][14], lastname[100][15];
       int hw[100];
       double gp[100], np[100], hr[100], taxrate[100], taxamt[100];
       int counter=0;
       int i;
       cout<<"ENTER EMP ID, FNAME, LNAME, HRS WORKED, HRLY RATE ctrl z to end"<<endl;
while( cin>>empid[counter]>>fname[counter]>>lastname[counter]>>hw[counter]>>hr[counter])
       counter=counter+1;
       for( i=0;i<counter;i++){
           gp[i]=hw[i]*hr[i];}//end grosspay for loop
       for( i=0;i<counter;i++){
            if(gp[i]>500)taxrate[i]=.30;
            else if(gp[i]>200)taxrate[i]=.20;
       else taxrate[i]=.10;
       }//FOR
       for(i=0;i<counter;i++){
       taxamt[i]=gp[i]*taxrate[i];}//end taxamount for loop
                 for(i=0;i<counter;i++){
                     np[i]=gp[i]-taxamt[i];}//end netpay for loop
                     cout<<endl;
                     cout<<setw(14)<<"EMPLOYEE ID"<<setw(16)<<"FIRST NAME"<<setw(17)
                     <<"LAST NAME"<<setw(4)<<"HW"<<setw(5)<<"HR"<<setw(6)
                     <<"GROSS"<<setw(6)<<"TAX"<<setw(9)<<"NET PAY"<<endl<<endl;
       for(i=0;i<counter;i++){
cout<<setw(14)<<empid[i]<<setw(16)<<fname[i]<<setw(17)<<lastname[i]<<setw(4)
<<hw[i]<<setw(5)<<hr[i]<<setw(6)<<gp[i]<<setw(6)<<taxamt[i]<<setw(9)<<np[i]<<endl;
}//FOR
system("PAUSE");
return 0;
}//MAIN 
Last edited on
cout << "Company XYZ\n\n"; ?

U could place it at the start of the program on line 10 then again after all of the input just before u enter the loop that displays the results...

Last edited on
I thought it was that simple idk why I even asked. My buddy made a big deal about it that's why I wasn't sure if something special needed to be done. Thanks dude
haha np
why make things complicated anyway ;)

Oh I just realized that u might have meant to change the main title bar. In that case u'll have to find the right function depending on the os since each has its own way. For windows it'd simply be:

SetConsoleTitle(_T("MY awesome title"));

If this is the 1st line after main() u'll still notice that there's a split second where the old title (the file path to ur .exe) is shown. I'm not sure how to have cmd actually open with ur desired title. That'd take some more complicated investigation...
Last edited on
thanks though for the info dude
Topic archived. No new replies allowed.