You are on page 1of 2

ESC 201: Problem Solving Through Programming

Practical Assignment No 01

Problem Statement:
1- Write a program to calculate salary of employee. Let HRA be 10 % of basic pay and TA be 5% of basic pay.
Let employee pay professional tax as 2% of total salary. Calculate net salary payable after deductions.
2- To accept an object mass in kilograms and velocity in meters per second and display its momentum.
Momentum is calculated ase=mc2 where m is the mass of the object and c is its velocity.

Algorithm:

Step 1: start .
Step 2: Take Basic pay Value As Input .
Step 3: Calculate HRA as 10% of Basic Pay .
Step 4 : Calculate TA as 5% of Basic Pay .
Step 5 : Calculate total_salary as the sum of basic_pay, HRA, and TA.
Step 6 : Calculate professional_tax as 2% of total_salary.
Step 7 : Calculate net_salary as total_salary minus professional_tax.
( net_salary = total_salary - professional_tax ) .
Step 8 : Print the net_salary value.
Step 9 : End Programe .
.

Program:
basic_pay = 85000
basic_pay = float(basic_pay)
hra = basic_pay*0.1
# hra is 10 % of basic pay
ta = basic_pay*0.05
# ta is 5 % of basic pay
total_salary = basic_pay + hra + ta
professional_tax = total_salary*0.02
# professional tax is 2 % of total salary
salary_payable = total_salary - professional_tax
print("Salary Payable is",salary_payable) .

Output =
[ Salary Payable is 95795.0 ] .

Problem Staement –
2- To accept an object mass in kilograms and velocity in meters per second and display its momentum.
Momentum is calculated ase=mc2 where m is the mass of the object and c is its velocity.

Algorithm:
Step 1: Start

STEP 2. Accept mass in kilograms

STEP 3. Accept vel in m/s

STEP 4. Momentum e=mass * (vel^2)

STEP 5. Print(Momentum e)

Step 6- STOP PROGRAME

Program:

m=50
c= 10
e=m*(c**2)
# c^2 ==> c**2
print('Momentum:', e)
.

Output =
[ Momentum: 5000 ] .

Roll No: BTCSD150 Name of student: OMKAR SHIRSAT

You might also like