PH309 Computational Physics Deadline: April 01, 2021 Homework 1 Department of Physics, UMT Lahore Important Instructions Objective of assignment The objective of the assignment is to give you some practice exercise of conditional statements. Instructions 1. Copied assignment will be marked zero. 2. Avoid plagiarism (copying others). In case of two similar copies, the assignment of both the students will be cancelled, even if the program is working correctly. 3. This is an individual task. 4. Send your work as a Julia Notebook (format .IPYNB) to arslan.hashim@umt.edu.pk. 5. The file name should be ”yourID-CPHW1.IPYNB” (for example F2020068002-CPHW1.IPYNB) and the subject of the email should be Computational Physics HW1 . Strictly follow the naming convention. 6. Read and understand the task again and again until you understand what you have to do. Program Program name: Pay-slip generation Problem Statement: You have to write a program for implementing a small-scale payroll computation system. This program inputs an employee’s grade, age and number of experience years and (depending on these values) prints the detailed pay-slip containing following sections. 1. Running Pay 2. Allowances 3. Deductions More detail about each section is given in following sub-section. 1 PH309 Computational Physics Deadline: April 01, 2021 Homework 1 Department of Physics, UMT Lahore Running Pay Each employee is given certain number of increments equal in number to his experience years. An increment means that the employee is paid some extra amount for each increment. The running pay (RP) is computed by using following formula: RP = basic salary + number of increments × per-increment amount. However, the catch here is that the basic salary (BS) and per-increment (PI) amount are determined by grade of the employee according to following table. (HINT: nested if-else to set basic salary and perincrement amount depending on grade) Grade A B C D Basic salary PKR 10000/PKR 12900/PKR 21700/PKR 32600/- Increment PKR 700/PKR 910/PKR 1500/PKR 2800/- So for example, if an employee has grade B and he has 3 years of experience. Then, his basic salary will be 12900/- and number of increments will be 3. So, the running pay will be 12900 + 3 × 910 = 15630. Allowances The allowances section contains types of allowances (monetary benefits) to employees depending on their basic salary and running pay. Three types of allowances are computed in this section according to rules given below: 1. House Rent Allowance (HRA): computed as 45% of running pay. 2. Social Security Benefits (SSB): computed as 30% of basic salary. 3. Ad-hoc relief allowance (ARA): A fixed amount of PKR 3000/- is given if the employee has grade A and is older than 40 years, otherwise, a fixed amount of PKR 1500/- is given. So, if an employee’s running pay is 15630/-, then his HRA = 15630 × 45/100 = 7033/-, SSB = 12910 × 30/100 = 3873/- and ARA = 1500/- as his grade is ‘B’. At the end of allowances section, employee’s Gross Pay (GP) is also shown, which is computed by summing up RP and all the allowances. (e.g. GP = RP + HRA + SSB + ARA = 15630 + 7033 + 3873 + 1500 = 28, 036. The gross pay is given to employee to nearest multiple of 100. E.g. in our example, the gross pay is computed as PKR 28, 036/-, then the employee is given PKR 28, 000/- and 36 rupees are donated to a charity organization. (HINT: use modulus % operator to determine the donation amount) Deduction The deduction section contains certain types of cuts (monetary deductions), such as income tax, on employee gross pay. Three types of deductions 2 PH309 Computational Physics Deadline: April 01, 2021 Homework 1 Department of Physics, UMT Lahore a. Income Tax (IT) IT is deducted using following rules on Annual Income (AI), where AI is computed by multiplying the gross pay (GP) with 12. E.g. in our example, AI is 28, 000 × 12 = 336, 000/- which corresponds to 0% income tax, i.e. no income tax. If, for some employee, the gross pay is 55, 000/- then AI = 55, 000 ∗ ×12 = 660, 000/-, which, according to following table, corresponds to annual income tax as 4.75% of gross pay (i.e. 660, 000 × 4.75/100 = 31, 350/annually, so, the monthly income tax will be 31, 350/12 = 2, 612/-) (HINT: Use nested if-else statement along with logical operators to determine the slab of income tax.) Slab 1 2 3 4 5 Annual GP Lower limit PKR 0/PKR 400, 001/PKR 650, 001/PKR 1, 000, 001/PKR 1, 500, 001/- Annual GP Upper limit PKR 400, 000/PKR 650, 000/PKR 1, 000, 000/PKR 1, 500, 000/∞ IT rate (% of gross pay) 0 2.5 4.75 7 11.5 b. General Provident Fund (GPF) 10%of monthly Gross pay. In our example, GPF = 28, 000 × 10/100 = 2, 800. c. Donation amount, which is computed from gross pay as explained in previous section is also displayed here. At the end of deductions section, total deductions amount is displayed, which is obtained by simply summing IT, GPF and the donation amount. In our example, Total deductions = 0 + 2, 800 + 36 = 2, 836/Finally, at the end of the pay-slip, Net pay is shown which is computed by subtracting deductions from gross pay. In our example, Net pay = 28, 036–2, 836 = 25, 206. 3