0% found this document useful (0 votes)
1 views8 pages

Arithmetic Operation Base Problem

The document outlines various Python programming problems focused on arithmetic operations, including calculations for the area and perimeter of squares and rectangles, the area of triangles and circles, volume and surface area of cubes and spheres, currency note counting, and conversions of days into years, months, and days. Each problem includes a sample input and output, along with the mathematical operations required to solve them. Additionally, it covers solving simultaneous equations using Cramer's Rule.

Uploaded by

adrikab38
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)
1 views8 pages

Arithmetic Operation Base Problem

The document outlines various Python programming problems focused on arithmetic operations, including calculations for the area and perimeter of squares and rectangles, the area of triangles and circles, volume and surface area of cubes and spheres, currency note counting, and conversions of days into years, months, and days. Each problem includes a sample input and output, along with the mathematical operations required to solve them. Additionally, it covers solving simultaneous equations using Cramer's Rule.

Uploaded by

adrikab38
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

ARITHMETIC OPERATION BASE PROBLEM

1. Area of a Square
Question: Write a Python program to input the side of a square and calculate its area.

Operation:

Area=Side2

Sample Input: 6

Sample Output: Area of square = 36 square units

Explanation: Area = 6 × 6 = 36

2. Perimeter of a Square
Question: Write a Python program to input the side of a square and calculate its perimeter.

Operation: Perimeter = 4 × Side

Sample Input: 8

Sample Output: Perimeter of square = 32 units

Explanation: Perimeter = 4 × 8 = 32

3. Area of a Rectangle
Question: Write a Python program to input the length and breadth of a rectangle and
calculate its area.

Operation: Area=Length×Breadth

Sample Input:

7
5

Sample Output: Area of rectangle = 35 square units

Explanation: Area = 7 × 5 = 35

1
4. Perimeter of a Rectangle
Question: Write a Python program to input the length and breadth of a rectangle and
calculate its perimeter.

Operation: Perimeter=2 * (Length+Breadth)

Sample Input:

10
6

Sample Output: Perimeter of rectangle = 32 units

Explanation: Perimeter = 2 × (10 + 6) = 2 × 16 = 32

5. Area of a Triangle
Question: Write a Python program to input the base and height of a triangle and calculate its
area.

Operation: Area=1/2×Base×Height

Sample Input:

12
8

Sample Output: Area of triangle = 48 square units

Explanation: Area = 1/2 × 12 × 8 = 48

6. Circumference of a Circle
Question: Write a Python program to input the radius of a circle and calculate its
circumference.

Operation: Circumference=2πr

Sample Input: 7

Sample Output: Circumference = 43.96 units

Explanation: Circumference = 2 × 3.14 × 7 = 43.96

2
7. Area of a Circle
Question: Write a Python program to input the radius of a circle and calculate its area.

Operation: Area=πr2

Sample Input: 5

Sample Output: Area of circle = 78.5 square units

Explanation: Area = 3.14 × 5 × 5 = 78.5

8. Surface Area of a Cube


Question: Write a Python program to input the side of a cube and calculate its surface area.

Operation: Surface Area=6a2

Sample Input: 4

Sample Output:

Surface area of cube = 96 square units

Explanation: Surface Area = 6 × 4² = 6 × 16 = 96

9. Volume of a Cube
Question: Write a Python program to input the side of a cube and calculate its volume.

Operation: Volume=a3

Sample Input: 3 Sample Output: Volume of cube = 27 cubic units

Explanation: Volume = 3 × 3 × 3 = 27

10. Surface Area of a Sphere


Question: Write a Python program to input the radius of a sphere and calculate its surface
area.

Operation: Surface Area=4πr2

Sample Input: 7 Sample Output: Surface area of sphere = 615.44 square units

Explanation: Surface Area = 4 × 3.14 × 7 × 7 = 615.44

3
11. Currency Note Counter Program
Question: Write a Python program to input an amount of money in rupees and display the
minimum number of 500, 200, 100, 50, 20, 10, 5, 2, and 1 rupee notes required to make that
amount.

Use:

• Floor Division Operator //


• Modulo Operator %

Denominations Used

Note Value Operation


Rs.500 amount // 500
Rs.200 remaining amount // 200
Rs.100 remaining amount // 100
Rs.50 remaining amount // 50
Rs.20 remaining amount // 20
Rs.10 remaining amount // 10
Rs.5 remaining amount // 5
Rs.2 remaining amount // 2
Rs.1 remaining amount // 1

Sample Input: 2989

Sample Output:

Rs.500 note = 5
Rs.200 note = 2
Rs.100 note = 0
Rs.50 note = 1
Rs.20 note = 1
Rs.10 note = 1
Rs.5 note = 1
Rs.2 note = 2
Rs.1 note = 0

Step-by-Step Explanation

Step 1: 2989 // 500 = 5

5 notes of Rs.500 are required.

Remaining amount: 2989 % 500 = 489

4
Step 2: 489 // 200 = 2

2 notes of Rs.200 are required.

Remaining amount: 489 % 200 = 89

Step 3: 89 // 100 = 0

0 notes of Rs.100 are required.

Remaining amount: 89 % 100 = 89

Step 4: 89 // 50 = 1

1 note of Rs.50 is required.

Remaining amount: 89 % 50 = 39

Step 5: 39 // 20 = 1

1 note of Rs.20 is required.

Remaining amount: 39 % 20 = 19

Step 6: 19 // 10 = 1

1 note of Rs.10 is required.

Remaining amount: 19 % 10 = 9

Step 7: 9 // 5 = 1

1 note of Rs.5 is required.

Remaining amount: 9 % 5 = 4

Step 8: 4 // 2 = 2

2 notes of Rs.2 are required.

Remaining amount: 4 % 2 = 0

Step 9: 0 // 1 = 0

0 notes of Rs.1 are required.

5
12. Conversion of Days into Years, Months and Days
Question: Write a Python program to input the total number of days. Assuming that:

• 1 year = 365 days


• 1 month = 30 days

Calculate and display the equivalent number of years, months and remaining days.

Operations Used

Years = Total Days // 365


Remaining Days = Total Days % 365

Months = Remaining Days // 30


Days = Remaining Days % 30

Sample Input: 800

Sample Output:

Years = 2
Months = 2
Days = 10

13. Area of a Triangle using Heron’s Formula


Question: Write a Python program to input the three sides of a triangle and calculate its area
using Heron’s Formula.

Formula: First calculate semi-perimeter:

s=a+b+c/2

Then calculate area: Area= SQUARE ROOT ( s(s−a)(s−b)(s−c))

Sample Input:

3
4
5

Sample Output: Area of triangle = 6 square units

6
14 . Solving Simultaneous Equations using Cramer’s Rule
Question: Write a Python program to solve the following simultaneous equations using
Cramer’s Rule:

Sample Input:

a1 = 2
b1 = 3
c1 = 13

a2 = 1
b2 = 2
c2 = 8

Sample Output:

x=2
y=3

Explanation:

Step 1: Find Determinant

(a1 × b2) − (a2 × b1)

= (2 × 2) − (1 × 3)

=4−3

=1

7
Step 2: Find x

x = (b2 × c1 − b1 × c2) / Determinant

= (2 × 13 − 3 × 8) / 1

= (26 − 24) / 1

=2

Step 3: Find y

y = (a1 × c2 − a2 × c1) / Determinant

= (2 × 8 − 1 × 13) / 1

= (16 − 13) / 1

=3

***************************

You might also like