Cs201 assignment 1 fall 2022| Cs201 assignment 1 solution fall 2022| CS201 assignment 1

#include <iostream>
using namespace std;

int employee(int scale){
    int salary, houseRent, allowance, totalPay;
    switch(scale)
    {
        case 1:
            salary = 50000;
            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:
            salary = 70000;
            houseRent = salary * 10/100;
            allowance = 5000;
            totalPay = salary + houseRent + allowance;
            cout<<" Basic Salary: "<< salary
                <<"\n House Rent: "<<houseRent
                <<"\n Utility Allowance: "<< allowance
                <<"\n Total Pay: "<< totalPay;
            break;
        case 3:
            salary = 90000;
            houseRent = salary * 10/100;
            allowance = 7000;
            totalPay = salary + houseRent + allowance;
            cout<<" Basic Salary: "<< salary
                <<"\n House Rent: "<<houseRent
                <<"\n Utility Allowance: "<< allowance
                <<"\n Total Pay: "<< totalPay;
            break;
        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;
}