In: Computer Science
I want Algorithim of this c++ code
#include<iostream>
using namespace std;
int main()
{
char repeat = 'y';
for (;repeat == 'y';){
char emplyeename[35];
float basic_Salary,EPF, Dearness_Allow, tax, Net_Salary , emplyee_id;
cout << "Enter Basic Salary : ";
cin >> basic_Salary;
Dearness_Allow = 0.40 * basic_Salary;
switch (01)
{case 1:
if (basic_Salary <= 2,20,00)
EPF = 0;
case 2:
if (basic_Salary > 28000 && basic_Salary <= 60000)
EPF = 0.08*basic_Salary;
case 3:
if (basic_Salary > 60000 && basic_Salary <= 200000)
EPF = (0.17)*(basic_Salary - 60000) + 22300;
Net_Salary = basic_Salary + Dearness_Allow - EPF;
cout<<"Employee Id : ";
cin>>emplyee_id;
cout<<"Employee Name : ";
cin>>emplyeename;
cout<<"EPF : "<<EPF<<endl;
cout<<"Dearness Allow : "<<Dearness_Allow<<endl;
cout<<"Net Salary : "<<Net_Salary<<endl;
cout<<"Do you want to still continue....Yes/No "<<endl;
cin>>repeat;}}
return 0;}
//Algorithm 1.Start 2. Assign repeat = 'y' 3. do the steps 3 .1 to 3.13 until (repeat equal to 'y') 3.1 input "Enter Basic Salary : ", basic_Salary 3.2 Dearness_Allow = 0.40 * basic_Salary 3.3 if (basic_Salary <= 2,20,00) then EPF = 0; 3.4 if (basic_Salary > 28000 and basic_Salary <= 60000) then EPF = 0.08*basic_Salary 3.5 if (basic_Salary > 60000 and basic_Salary <= 200000) then EPF = (0.17)*(basic_Salary - 60000) + 22300 3.6 Net_Salary = basic_Salary + Dearness_Allow - EPF 3.7 Input "Employee Id : ",emplyee_id 3.8 Input "Employee Name : ",emplyeename 3.9 Display "EPF : ",EPF 3.10 Display "Dearness Allow : "Dearness_Allow 3.11 Display "Net Salary : ",Net_Salary 3.12 Display "Do you want to still continue....Yes/No " 3.13 Input repeat 4.Stop |
Screen shot of the algorithm |
Please comment if any query