0% found this document useful (0 votes)
2 views3 pages

Python LAB 2

The document outlines a series of programming assignments for students in the Department of Computer Applications at Techno India University, West Bengal. Each assignment involves developing Python scripts to solve various problems, including calculating profits, determining geometric shapes, validating years, and generating bills for utilities and services. Students are instructed to submit their work via email and can ask questions during theoretical classes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Python LAB 2

The document outlines a series of programming assignments for students in the Department of Computer Applications at Techno India University, West Bengal. Each assignment involves developing Python scripts to solve various problems, including calculating profits, determining geometric shapes, validating years, and generating bills for utilities and services. Students are instructed to submit their work via email and can ask questions during theoretical classes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Techno India University, West Bengal.

Department of Computer Applications.

LAB Assignment 2

Send your softcopy to: abchaudhuri007@[Link]. For any queries ask me in the
theoretical class.

1. A program is to be developed in Python to find out the profit or loss on a sale.


2. Python script is to be developed to test whether a given integer is even or odd by
using Ternary Operators.
3. To determine whether a quadrilateral is a square, rhombus, parallelogram, square
or irregular on the basis of only the lengths of all the sides and one internal angle.
4. To categorize a triangle on the basis of its three given angles. The triangle may be
in an ‘invalid triangle’, ’Equiangular’, ‘ right-angle’, ‘acute angled’ or ‘obtuse
angled’.
5. To accept the lengths of three sides of a triangle to check whether the given
lengths can be valid lengths of three sides of a triangle and to categorize the
triangle as ‘Equilateral’ or ‘Isosceles’ or ‘Scalene’ one.
6. It is required to develop a Python script to test if a given year is a leap year or not
by using Ternary Operators.
7. A program is to be developed in Python to validate a given year.
8. Develop a Python script to determine the minimum number of 100 rupee notes,
200 rupee notes, 500 rupee notes and 2000 rupee notes required to dispense a
given sum of money.
9. To calculate commission of a salesman when the calculation of commission is
based on the rules given below:
(i) Nil, when the sales<10000 in region A
(ii) 6.5% of the sales if the sales<15000 in region B and <16000 in region A
(iii) 8.5% plus Rs.1500, if the sales>=15000 but <25000 in region B and >=16000
but < 35000,in region A.
(iv) 11% of the sales plus Rs.4500 for all regions for all other cases.

10. It is required to develop a program to determine the roots of a quadratic equation.


11. In a workshop, the workers are paid on hourly basis at the end of each week based
on the total hours worked in the week. The payment rules are as stated below:
 For the first 37 hours, the rate of pay is fixed at Rs.23 per hour;
 For the next 28 hours, the rate is Rs. 31 per hour and
 For the rest, if any, the rate is fixed at Rs, 41 per hour.

12. The electricity company serving in a certain city installs meters having 7-digit
readings at the premises of its consumers to determine the units consumed at the
end of each billing period by calculating the difference between two consecutive
meter readings. The electricity is charged according to the rules stated below:
Units consumed Rate/unit(Rs.)

For the first 25 4.89


For the next 35 5.45
For the next 24 6.41
For the rest 9.95

A meter rent of Rs. 15 is also added to the computed charge to make the final bill.
It is required to develop a program in Python to generate the electricity bill for the
consumers for each billing period.
13. In a certain country with currency as Rs., the registration charge of letters parcels
etc. is calculated according to the rules described below:
For the first 10 gm or part thereof, the charge is fixed at Rs. 23. For next every 11
gm or part thereof the charge is Rs. 17.75 and it is up to a maximum total weight of
375 gm after which the charge is calculated for every extra gm of weight @Rs,1.75.
Develop a Python script to calculate the registration charge as per the rules stated.

14. In a certain institution, the final result of the students is based on faculty
assessment and End Semester Assessment. The faculty assessment carries a
maximum of 20 marks. The following rules are applied by the controller of
examinations to determine whether a student passes or fails:
(i) A student must score 40 or more in order to pass.
(ii) A total mark of 35 is moderated to 40%; , however,
(iii) Each component must be passed with a minimum of 25% marks
(iv) If a student scores 40% or more but does not achieve the minimum
marks of 25% in each of the components, he is given a ‘Technical Fail’ of
35% which is not moderated to 40%
Develop a Python script to accept marks of each component for a student in order to
determine the final score and the result.
15. It is required to develop a Python script to determine the exact number of elapsed
days between any two given dates considering the leap years and the number of
days in months are same or different according to the convention.
16. To compute the festival bonus of the employees on the basis of the basic pay and
the designation as per the following rules:
Basic Pay Designation Percentage of basic pay payable
<40,000 Manager 12% of the basic pay subject to minimum of Rs. 2500
>=40,000 Manager 16% of the basic pay subject to maximum of Rs. 7500
<20000 Officer 14% of the basic pay subject to a minimum of Rs.2500
and a mximum of Rs.5000.
For all others 8.9% of basic pay

17. A telephone company charges its subscribers on the basis of the following rules at
the end of each month:
For the first 75 calls, the charge is fixed and it is equal to Rs. 75; for the next 75
calls, the charge is calculated @Rs 0.75 per call; for the next 90 calls, the charge is
Rs.0.65 per call and for the rest, if any, the rate is Rs.0.55 per call.
It is required to determine the monthly bill of a subscriber.
18. In a certain country, the difference between two consecutive gas meter readings
gives the amount of gas consumed in cubic feet. It is then multiplied by a factor
1.475 to convert it into the number of therms used by the consumer, where therm
is the unit of billing. The meter readings are collected at the end of each month.
The following rate chart is then used by the gas company to calculate the bill
amount of each consumer:
No. of therms used Rate per therm
<=125 Rs.7.75
>125 but <=250 Rs. 9.75 plus a surcharge of 1.25%
over the calculated charge;
>250 Rs. 13.00 plus a surcharge 0f 2.5% over
the calculated charge.
A meter rent of Rs.25 is also added to the gas charges of each consumer to
determine the gas bill.
If the gas meters display 8-digit readings, then develop a script in Python is
required to determine the monthly gas bill of the consumers.
19. In a certain area, the parking charge for cars is calculated according to the
following rules:
For the first 8.5 hours or part thereof, the rate is fixed and it is equal to Rs. 55; for
the next every 2 hours or part thereof up to a maximum of 23 hours, the rate Rs.
13.75; beyond the 23 hours limit, the charge Rs. 5.50 for every minute.
Develop a Python script to calculate the parking charge for the users of the area.

You might also like