PPS - Practical - Assignment - 1 To 5 PDF
PPS - Practical - Assignment - 1 To 5 PDF
Problem statement: To calculate salary of an employee given his basic pay (take as
input from user). Calculate gross 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.
Objective: To read salary details as input from user and display the gross salary.
Theory:
1. Explain all data types with syntax and examples
2. Explain identifiers and list rule of identifiers with example
3. Explain literals with example
Algorithm:
Step1: Start
Step2: Variable initializations
Step3: Accept basic pay from user
Step4: If value of basic pay is negative then ask user to enter positive value for basic pay
step5: Compute salary as
Hra = (basic_pay/100)*10; ta = (basic_pay/100)*5;
Temp_salary = basic_pay + hra + ta; ptax = (temp_salary/100)*2
Salary = temp_salary - ptax;
Step6: Display salary
Step7: Stop
Flowchart:
Program:
Write down your own created and executed program code along with all possible
outputs which you have performed at practical session.
Conclusion:
By implementing this assignment we learn the concepts and use of data types,
identifiers, literals and built-in functions.
Assignment 2
Objective: To read numbers and store them into a list using for loop.
Theory:
1. Explain For Loop and While loop with examples and flowchart
2. Explain list built-in function with examples
Algorithm:
Step 1: Start
Step 3: Accept ‘n’ numbers from user and store them in a list
Step 6: Check if element is less than min then assign min equal to the element
Step 7: Check if element is greater than max then assign max equal to the element
Flowchart:
Write down your own created and executed program code along with all possible
outputs which you have performed at Practical Session.
Conclusion:
By implementing this assignment we learn the concepts and use of looping control
structure and list built-in functions.
Assignment 3
Problem Statement: To accept student’s five courses marks and compute his/her
result. Student is passing if he/she scores marks equal to and above 40 in each course. If
student scores aggregate greater than 75%, then the grade is distinction. If aggregate is
>=60% and <50%, then the grade is first division. If aggregate is >=50%and <60%, then
the grade is second division. If aggregate is >=40% and <50%, then the grade is third
division.
Objective: To read five subjects marks and store them into list,find out the gradings using
conditional statement
Theory:
1. Explain
a. If statement with example and flowchart
b. If…..else statement with example and flowchart
c. If….elif…..else statement with example and flowchart
d. Nested if statement with example and flowchart
Algorithm:
Step 1: Start
Step 2: Accept marks of subject 1 out of 100
Step 3: Check if subject1 marks <40, if yes go to step 4 otherwise go to step 5
Step 4: Display message “Fail” go to 27
Step 5: Accept marks of subject 2 out of 100
Step 6: Check if subject2 marks <40, if yes go to step 7 otherwise go to step 8
Step 7: Display message “Fail” go to 27
Step 8: Accept marks of subject 3 out of 100
Step 9: Check if subject3 marks <40, if yes go to step 10 otherwise go to step 11
Step 10: Display message “Fail” go to 27
Step 11: Accept marks of subject 4 out of 100
Step 12: Check if subject4 marks <40, if yes go to step 13 otherwise go to step 14
Step 13: Display message “Fail” go to 27
Step 14: Accept marks of subject 5 out of 100
Step 15: Check if subject 5 marks <40, if yes go to step 16 otherwise go to step 17
Step 16: Display message “Fail” go to 27
Step 17: Compute Total as subject 1 + subject 2 + subject 3 + subject 4 + subject 5
Flowchart:
Program:
Write down your own created and executed program code along with all possible
outputs which you have performed at Practical Session.
Conclusion:
Theory:
1. Explain function with example
2. Explain modules with examples
3. Explain Packages and use of it
4. Explain built-in packages(sys , IO)
Algorithms:
Step 1: Start
Step 3: Accept the user’s choice (1/2/3/4/5) and accordingly it will execute operations
Program:
Write down your own created and executed program code along with all possible
outputs which you have performed at Practical Session.
Conclusion:
Objective: To read number, extract individual digit from it and check number
is Armstrong or not
Theory:
1. Explain String with example
2. Explain
a. Concatenation (+) ,
b. Append (+=),
c. Repetition (*) Operators,
d. Slice (:) Operation
3. Explain string and iteration of string using loop
Algorithm:
Step 1: Start
Step 3: sum =0
Step 7: Check if sum is equal to the number entered by user if yes go to step 8
otherwise go to step 9
Program:
Write down your own created and executed program code along with all possible
outputs which you have performed at Practical Session.
Conclusion: