php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I wanted to program this in a manner that it will display
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
RESPECTED SIR ,

YOURS WAY OF TEACHING IS EXCELLENT , I HAVE NO IDEA OF PROGRAMMING BUT AFTER TAKING YOURS LECTURES I AM ABLE

TO PROGRAM A LITTLE SIR IN YOUR HANDOUTS YOU HAVE GIVEN THE PROBLEM OF PAY ROLL

I WANTED TO PROGRAM THIS IN A MANNER THAT IT WILL DISPLAY

FIRST GROSS SALARY

THEN NET SALARY

AND AFTER THIS IT WILL DISPLAY THE UNLUCKY ONES I HAVE CODED THIS PROBLEM KINDLY GIVE ME THE CORRECT CODE

AND TELL MY MISTAKES SO THAT I WILL ABLE TO BECOME THE GOOD PROGRAMMER ,THANKS.THE UNLUCKY ONES ARE THOSE WHOSE

NET SALARIES ARE LESS THEN THOSE ONES WHOSE TAKE MORE SALARIES BUT THIER GROSS SALARIES ARE MORE

THE CODE IS WRITTEN HERE

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; cout<<"PLEASE ENTER THE NUMBOR OF EMPLOYEES "; cin>>numemps; const int arraysize=100; double sal[arraysize][2]; int lucky[arraysize]={0}; getsalary(sal,numemps); cout<<endl; cout<<"DISPLAY THE GROSS SALARY "; cout<<endl; displaysalary(sal,numemps); cout<<"THE NET SALARY IS HERE "; cout<<endl; calcsalary(sal, numemps); cout<<getch(); cout<<"THE UNLUCKY EMPLOYEES ARE HERE "; cout<<endl; findunluckies(sal,lucky,numemps); } void getsalary(double sal[][2],int numemps) { int i; for (i=0;i<numemps;i++) { cout<<"PLEASE ENTER THE SALARY OF EACH EMPLOYEE # "; cout<<i; cout<<'\t'; cin>>sal[i][0]; } } void displaysalary (double sal[][2],int numemps) { int i; for (i=0;i<numemps;i++) { cout<<sal[i][0]; 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; } } } 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; } } for (i=0;i<=numemps;i++) { if ( lucky[i] ==1) cout<<lucky[i]; cout<<endl; } }
Reply


Messages In This Thread
I wanted to program this in a manner that it will display - by sana.pari - 04-24-2011, 04:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  c++ program on unix varup 0 7,645 10-10-2012, 06:16 PM
Last Post: varup
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 3,069 05-31-2012, 01:40 AM
Last Post: Vuhelper
  program Output in C++ 2012 Vuhelper 0 3,037 01-06-2012, 12:28 AM
Last Post: Vuhelper
  For running C++ program from command prompt “gcc” and “g++” compilers are used. Vuhelper 0 6,446 01-04-2012, 10:41 PM
Last Post: Vuhelper
  Function (Retrun push)for what purpose use in the program. ? Vuhelper 0 1,914 11-05-2011, 05:03 PM
Last Post: Vuhelper
  C++ Help with Template class program 2011 Vuhelper 0 880 07-23-2011, 05:40 PM
Last Post: Vuhelper
  A simple pthread program runtime error in c++ 2011 Vuhelper 0 959 07-23-2011, 05:39 PM
Last Post: Vuhelper
  Problem with the complexity of the program 2011 Vuhelper 0 799 07-06-2011, 06:19 PM
Last Post: Vuhelper
  How to set Display Settings to EXTEND mode in Windows 7 using C++? Vuhelper 0 1,937 07-06-2011, 06:17 PM
Last Post: Vuhelper
  Write a calculator program using a do-while loop in c++ 2011 Vuhelper 0 2,824 06-27-2011, 06:41 PM
Last Post: Vuhelper

Forum Jump:


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