Welcome

CS201 Assignment No 1 solution 2020

CS201 Assignment No 1 solution 2020

#include<iostream>
using namespace std;

int main(){
int payscale, initialSalary, incrementRate, taxDeductionRate;
float incrementValue, taxValue, netSalary = 0;

cout << “\n*********** SALRY CALCULATOR **************”<<endl;
cout << “\n*******************************************”<<endl;
cout << “\n*********** ENTER 1 FOR SPS6 *************”<<endl;
cout << “\n*********** ENTER 2 FOR SPS7 *************”<<endl;
cout << “\n*********** ENTER 3 FOR SPS8 *************”<<endl;
cout << “\n*********** ENTER 4 FOR SPS9 *************”<<endl;

cout << “\n Select a pay scale from the menu : “;

cin >> payscale;
if(payscale == 1){
initialSalary = 40000;
incrementRate = 20;
taxDeductionRate = 3;
}else if(payscale == 2){
initialSalary = 60000;
incrementRate = 15;
taxDeductionRate = 3;
}else if(payscale == 3){
initialSalary = 80000;
incrementRate = 10;
taxDeductionRate = 3;
}else if(payscale == 4){
initialSalary = 100000;
incrementRate = 5;
taxDeductionRate = 3;
}else{
cout << “\n Selected choice is invalid\n”;
return 0;
}
incrementValue = ((initialSalary * incrementRate) / 100);
taxValue = (((initialSalary + incrementValue) * taxDeductionRate) / 100);
netSalary = (initialSalary + incrementValue) – taxValue;
cout << “\n Initial Salary : ” << initialSalary;
cout << “\n Increment Amount : ” << incrementValue;
cout << “\n Increased Salary : ” << initialSalary + incrementValue;
cout << “\n Tax Deduction : ” << taxValue;
cout << “\n Net Salary : ” << netSalary;
}

0 0 votes
Article Rating

Leave a Reply

0 Comments
Inline Feedbacks
View all comments
%d bloggers like this: