php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
# include main() { cout<< "How are u? welcome to my program"; }
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#3
Dear Student,
The corrected modified code of your program is given below. There were few errors in your code. Please compare this code with your previous code and point out your mistakes which you had done.

Code:
#include<iostream.h> #include<conio.h> void getsalary(double sal[][2],int); void displaysalary (double sal[][2],int); void calcsalary(double sal[][2],int); void findunluckies(double sal[][2],int lucky[],int); main() { int numemps; const int arraysize=100; double sal[arraysize][2]; int lucky[arraysize]={0}; cout<<"PLEASE ENTER THE NUMBER OF EMPLOYEES:\t"; cin>>numemps; getsalary(sal,numemps); cout<<endl; cout<<"DISPLAY THE GROSS SALARY:\t\t"; cout<<endl; displaysalary(sal,numemps); cout<<"THE NET SALARY IS HERE:"; cout<<endl; calcsalary(sal, numemps); cout<<"THE UNLUCKY EMPLOYEES ARE HERE:"; cout<<endl; findunluckies(sal,lucky,numemps); system("pause"); } void getsalary(double sal[][2],int numemps) { int i; for (i=0;i<numemps;i++) { cout<<"PLEASE ENTER THE SALARY OF EACH EMPLOYEE "<<i+1; cout<<":\t"; cin>>sal[i][0]; } cout<<endl; } void displaysalary (double sal[][2],int numemps) { int i; for (i=0;i<numemps;i++) { cout<<sal[i][0]; cout<<endl; } cout<<endl; } void calcsalary(double sal[][2],int numemps) { double tax; int i; int j; for (i=0;i<numemps;i++) { if (sal[i][0]<=10000) { tax=0; cout<<sal[i][0]; cout<<endl; } else if (sal[i][0]>10000) { tax=0.05*sal[i][0]; sal[i][1]=sal[i][0]-tax; cout<<sal[i][1]; cout<<endl; } else if (sal[i][0]>15000) { tax=0.15*sal[i][0]; sal[i][1]=sal[i][0]-tax; cout<<sal[i][1]; cout<<endl; } } cout<<endl; } void findunluckies(double sal[][2],int lucky[],int numemps) { int i; for (i=0;i<=numemps;i++) { if (sal[i][0]>sal[i][1]) { lucky[i]=1; break; } } cout<<endl; for (i=0;i<=numemps;i++) { if ( lucky[i] ==1) { cout<<lucky[i]; cout<<endl; } } cout<<endl; }
Reply


Messages In This Thread
# include main() { cout<< "How are u? welcome to my program"; } - by Support - 04-24-2011, 04:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  c++ program on unix varup 0 7,684 10-10-2012, 06:16 PM
Last Post: varup
  how to check include library in Dev C++ Vuhelper 0 3,450 06-09-2012, 06:18 PM
Last Post: Vuhelper
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 3,124 05-31-2012, 01:40 AM
Last Post: Vuhelper
  what is main logic behind turning a register into byte count other than multiplying 2 Vuhelper 0 2,909 05-31-2012, 01:29 AM
Last Post: Vuhelper
  std::cout<<"---"; " and also for cin " std::cin>>x; in C++ 2012 Vuhelper 0 3,257 01-14-2012, 05:46 PM
Last Post: Vuhelper
  program Output in C++ 2012 Vuhelper 0 3,080 01-06-2012, 12:28 AM
Last Post: Vuhelper
  Argc(argument count) and argv(argument value) are used in main function Vuhelper 0 2,123 01-04-2012, 10:42 PM
Last Post: Vuhelper
  For running C++ program from command prompt “gcc” and “g++” compilers are used. Vuhelper 0 6,479 01-04-2012, 10:41 PM
Last Post: Vuhelper
  Why we write main rgc,char**argv in C++ 2012 Vuhelper 0 3,114 01-04-2012, 10:36 PM
Last Post: Vuhelper
  Function (Retrun push)for what purpose use in the program. ? Vuhelper 0 1,956 11-05-2011, 05:03 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 2 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support