You are on page 1of 3

CS201 Fall2022

ASSIGNMENT NO1 BY: Easy to learn with M.Zeeshan

Kindly subscribe my channel for more helping material. Thankyou.

#include <iostream>

using namespace std;

int employee(int scale){

int salary, houseRent, allowance, totalPay;

switch(scale)

case 1:

salary = 50000;

//Easy to learn with M.Zeeshan

houseRent = salary * 10/100;

allowance = 3000;

totalPay = salary + houseRent + allowance;

cout<<" Basic Salary: "<< salary

<<"\n House Rent: "<<houseRent

<<"\n Utility Allowance: "<< allowance

<<"\n Total Pay: "<< totalPay;


break;

case 2:

// Easy to learn with M.Zeeshan

salary = 70000;

houseRent = salary * 10/100;

allowance = 5000;

totalPay = salary + houseRent + allowance;

cout<<" Basic Salary: "<< salary

// Easy to learn with M.Zeeshan

<<"\n House Rent: "<<houseRent

<<"\n Utility Allowance: "<< allowance

<<"\n Total Pay: "<< totalPay;

break;

// Easy to learn with M.Zeeshan

case 3:

salary = 90000;

houseRent = salary * 10/100;

allowance = 7000;

// Easy to learn with M.Zeeshan

totalPay = salary + houseRent + allowance;

cout<<" Basic Salary: "<< salary

<<"\n House Rent: "<<houseRent

<<"\n Utility Allowance: "<< allowance

<<"\n Total Pay: "<< totalPay;

break;
// Easy to learn with M.Zeeshan

default:

cout<<"Incorrect Range... \nEnter the scale of employee(1-3)";

break;

int main() {

int scale;

cout << "Enter your scale (1-3): ";

cin >> scale;

employee(scale);

return 0;

You might also like