im a first year student of computer science course. our teacher teach us c++ program and i cant understand it well.now my teacher want us to make a menu system or payroll system.. the format she teach us is like this
1.) write a program that will accept users input name and display the inputed name in the browser.

#include<stdio.h>
#include<conio.h>
void main()
{
char name[15};
clrscr();
printf("Enter your name");
scanf("%s",&name);
printf("%s",name);
getch();
}

this one simple but now how to make a menu or payroll system?

Recommended Answers

All 11 Replies

hi i'm also a newbie in the programming world and i tried to make the work.. here's my work.. just try to edit it to the output that you want..

here's the sample of a payroll program:


//Employees Payroll Program

i

nclude<iostream>
using namespace std;

int main()

{ 
      char FName[15];
      char LName[15];
      

      int WD,NHD,HOT,HUT,NT;
      float GP,WPD,WHD,HD,OTR,OT,UTR,UT,T,DDT;
      double TGP,TD,NP;

      cout<<"\n";
      cout<<"Please Enter First Name: "
      cin>>FName;
      cout<<"\n";
      cout<<"Please Enter Last Name: "
      cin>>LName;
      cout<<"\n";
      
         {
           WPD=GP/WD
           WHD=WPD*.5
            HD=NHD*WHD
            OTR=WPD*.15
            OT=OTR*HOT
            UTR=WPD*.15
            UT=UTR*HUT
            TGP=GP+HD+OT-UT
           }
         
         cout<<"		Salary Proper:		\n";cout<<"\n";
         cout<<"Please Enter The Gross Pay: "<<GP;cout<<"\n";
         cout<<"Please Enter The Number of Work Days: "<<WD;cout<<"\n";
         cout<<"Estimated Wage Per Day: "<<WPD;cout<<"\n";
         cout<<"Please Enter The Number of Half-days: "<<NHD;cout<<"\n";
         cout<<"Estimated Wage Per Half-day: "<<WHD;cout<<"\n";
         cout<<"Total Wage Due to Half-days: "<<HD;cout<<"\n";
         cout<<"Please Enter The Hours of Overtime: "<<HOT;cout<<"\n";
         cout<<"Estimated Overtime Rate Per Hour: "<<OTR;cout<<"\n";
         cout<<"Total Wage Due to Overtime: "<<OT;cout<<"\n";
         cout<<"Please Enter The Hours of Undertime: "<<HUT;cout<<"\n";
         cout<<"Estimated Undertime Rate Per Hour: "<<UTR;cout<<"\n";
         cout<<"Total Wage Due to Undertime: "<<UT;cout<<"\n";
         cout<<"Total Gross Pay: "<<TGP;cout<<"\n";

         cout<<"		          Deductions:			                       
           {
               T=WPD*.02
             DDT= NT*T
            }

          cout<<"		    Punctuality Deductions:   		\n";cout<<"\n";
          cout<<"Please Enter The Number Of Tardiness: "<<NT;cout<<"\n";
         cout<<"Estimated Rate For Every Tardiness: "<<T;cout<<"\n";
         cout<<"Total Deduction Due to Tardiness: "<<DDT;cout<<"\n";

              {
                NP=TGP-DDT-TD
               }

         cout<<FName,LName<<" Net Pay: "<<NP;cout<<"\n";	

          return 0;

}

hope this copuld help you..

™Thug Line™

thank you so much.. this will help me a lot..:)
from what place are you?

im from the philippines

you??

same here..philippines..:)

what is "cout"????

what is "cout"????

try this

This thread is tragic. Wouldn't be a bad substitute for the end of Romeo and Juliet :P


All of you, newbs, above, seem to have no lust for C++. You can only truely understand it if you appreciate it, and you can only appreciate it if you want to.

Wena, you don't seem to be using C++, you're using C. C++ uses iostream. I suggest you use google abit to learn about I/O in C++
Its not so hard to make a payroll program, a complete beginner can make one on the 3rd/4th day of learning the language :P

Hi! I need this in my examination in TESDA – Procedural Programming for NC4. I have made some debugging…

#include<iostream.h>
#include<conio.h>

main(){
  char FName[15];
  char LName[15];

  int WD,NHD,HOT,HUT,NT;
  float GP,WPD,WHD,HD,OTR,OT,UTR,UT,T,DDT;
  double TGP,TD,NP;

  clrscr();
  cout<<"\nPlease Enter First Name: ";cin>>FName;
  cout<<"\nPlease Enter Last Name: ";cin>>LName;
  cout<<"\n";

  cout<<"	Salary Proper: \n\n";
  cout<<"Please Enter The Gross Pay: ";cin>>GP;
  cout<<"Please Enter The Number of Work Days: ";cin>>WD;WPD=GP/WD;
  cout<<"Estimated Wage Per Day: "<<WPD<<"\n";
  cout<<"Please Enter the Number of Half-days: ";cin>>NHD;WHD=WPD*.5;
  cout<<"Estemated Wage Per Half-day: "<<WHD<<"\n";HD=NHD*WHD;
  cout<<"Total Wage Due to Half-days: "<<HD<<"\n";
  cout<<"Please Enter The Hours of Overtime: ";cin>>HOT;OTR=WPD*.15;
  cout<<"Estemated Overtime Rate Per Hour: "<<OTR<<"\n";OT=OTR*HOT;
  cout<<"Total Wage Due to Overtime: "<<OT<<"\n";
  cout<<"Please Enter the Hours of Undertime: ";cin>>HUT;UTR=WPD*.15;
  cout<<"Estemated Undertime Rate Per Hour: "<<UTR<<"\n";UT=UTR*HUT;
  cout<<"Total Wage Due to Undertime: "<<UT<<"\n";TGP=GP+HD+OT-UT;
  cout<<"Total Gross Pay: "<<TGP<<"\n\n";

  cout<<"	Punctuality Deductions:	\n\n";
  cout<<"Please Enter The Number of Tardiness: ";cin>>NT;T=WPD*.02;
  cout<<"Estemated Rate for Every Tardiness: "<<T<<"\n";DDT=NT*T;
  cout<<"Total Dedcution Due to Tardiness: "<<DDT<<"\n";NP=TGP-DDT;
  cout<<FName<<" "<<LName<<" Net Pay: "<<NP<<"\n";

  getch();
  return 0;

  }

Tnxs! ;)

oww its not working"(O_O)"

Please help for payroll management coding turboC++

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.