Skip to content

Instantly share code, notes, and snippets.

@Fatima-progmmer
Created February 8, 2025 11:32
Show Gist options
  • Save Fatima-progmmer/dd81eb0dc7433c2d1ad8cfa06d776355 to your computer and use it in GitHub Desktop.
Save Fatima-progmmer/dd81eb0dc7433c2d1ad8cfa06d776355 to your computer and use it in GitHub Desktop.
C++ program calculates the total salary for permanent and daily wage employees, considering their working hours and medical allowances
#include<iostream>
using namespace std;
int main()
{
int choice, permanenthour, wdgehour;
char want;
do
{
cout <<"Which type of employe you are?\n1.permanant\n2.daily wages\n";
cin >> choice;
switch(choice)
{
case 1:
{
cout << "Enter your daily working hour ="; cin >> permanenthour;
cout << "You medical allowance is 5%"<< endl;
cout << "You total salary is " <<5/100*permanenthour+permanenthour*800;
break;
}
case 2:
{
cout << "Enter your daily working hour=";
cin >> wdgehour;
cout << "You medical allowance is 3%" << endl;
cout << "You total salary is " <<3/100*wdgehour+wdgehour*400;
break ;
}
}
cout <<"\nDo you want to continuous?\n";
cin >> want;
}
while (want!='n');
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment