You are on page 1of 11

1. Trisha exercises daily by running around a circular field of radius 42 metres.

After
circling the field thrice, she runs back home for 12 metres. Write a program to
calculate the distance she covers in a week. If she loses 2 calories for every 25
metre of running, calculate and print the number of calories lost by Trisha in a week.

Program:

r=42

one_round = 2 * 22/7 * r

daily = 3 * one_round + 12

week = daily * 7

calorie = week / 25 * 2

print("Total distance covered in a week : ",week," metres")

print("Calories lost in a week : ", calorie," cal ")

Output:

Total distance covered in a week : 5628.0 metres

Calories lost in a week : 450.24 cal


2. Kamadhenu finance offers two investment plans for customers. Plan 1 offers
simple interest of 16% for a principal amount invested for 5 years and Plan 2 offers
18% for 6 years. Salma is planning to invest a sum of Rs. 600000 in Kamadhenu
finance. Write a program to print the amount that Salma would receive at the end of
term in Plan 1 and Plan 2 and the difference in the interest amount between the two
investment plans.

Program:

p = 600000

plan1= p * 16 / 100 * 5

plan2 = p * 18 / 100 * 6

amount1= p + plan1

amount2= p + plan2

print("Amount after 5 years in Plan 1 is Rs. ",amount1)

print("Amount after 6 years in Plan 2 is Rs. ",amount2)

diff = plan2 - plan1

print("Difference in interest is : Rs. ",diff)

Output:

Amount after 5 years in Plan 1 is Rs. 1080000.0

Amount after 6 years in Plan 2 is Rs. 1248000.0

Difference in interest is : Rs. 168000.0


3. Write a program to accept the length, breadth and height of a cuboid. Calculate
the surface area and volume of the cuboid.

Program:

length = int(input("Enter the length of a cuboid"))

breadth = int(input("Enter the breadth of a cuboid"))

height = int(input("Enter the height of a cuboid"))

volume = length * breadth * height

print("Volume of the cuboid = ",volume," cu. units")

s_area = 2 *(length*breadth + breadth * height + length * height)

print("Surface area of the cuboid = ",s_area," sq. units")

Output:

Enter the length of a cuboid6

Enter the breadth of a cuboid4

Enter the height of a cuboid5

Volume of the cuboid = 120 cu. units

Surface area of the cuboid = 148 sq. units


4. Pariksha is a testing agency that conducts competitive exams. The agency is
trying to prepare answer booklets for a test using A4 sheet bundles. Write a
program to accept the number of A4 sheets that should be present in an answer
booklet and the number of A4 sheets that come in one bundle. Calculate and print
the number of booklets that can be made from one bundle and the A4 sheets that
will remain. Also, if there are 500 students who will take the test, what is the
minimum number of A4 bundles that will be required.

Program:

booklet = int(input("Enter number of sheets in the booklet"))

bundle = int(input("Enter number of sheets in a bundle of A4 sheets"))

count = bundle // booklet

remaining = bundle % booklet

minbundle = booklet * 500 // bundle

print("Number of booklets that can be made from a bundle is : ",count)

print("Number of A4 sheets remaining in a bundle is : ",remaining)

print("Minimum number of A4 bundles required for 500 students is : ",minbundle)

Output:

Enter number of sheets in the booklet25

Enter number of sheets in a bundle of A4 sheets100

Number of booklets that can be made from a bundle is : 4

Number of A4 sheets remaining in a bundle is : 0

Minimum number of A4 bundles required for 500 students is : 125


5. An electronic showroom sells Television, Music system and Smart phones. The
price of a television is Rs. 25000, music system is Rs. 10000 and Smart phone is Rs.
15000. At the end of everyday, the shopkeeper tallies the amount collected against
the items sold. Write a program to accept the number of Televisions, Music systems
and Smart phones sold on a day. Calculate and print the amount collected at the end
of the day in the format shown below.

ELECTRONIC SHOWROOM SALES

--------------------------------------------------------------------

Item Quantity Amount

--------------------------------------------------------------------

Television 5 125000

Music system 4 40000

Smart Phone 3 45000

--------------------------------------------------------------------

Grand Total 210000

Program:

tv=int(input("Enter number of TVs sold"))

ms=int(input("Enter number of Music systems sold"))

sp=int(input("Enter number of Smart phones sold"))

tvsales = tv * 25000

mssales = ms * 10000

spsales = sp * 15000

totsales = tvsales + mssales + spsales

print("\t ELECTRONIC SHOWROOM SALES ")

print("-" * 60)

print("Item \t\t Quantity \t\t Amount")

print("-" * 60)

print("Television",tv,tvsales,sep="\t\t")

print("Music system",ms,mssales,sep="\t\t")
print("Smart Phone",sp,spsales,sep="\t\t")

print("-" * 60)

print("\tGrand Total",totsales,sep="\t\t\t")

Output:

ELECTRONIC SHOWROOM SALES

------------------------------------------------------------

Item Quantity Amount

------------------------------------------------------------

Television 5 125000

Music system 4 40000

Smart Phone 3 45000

------------------------------------------------------------

Grand Total 210000


6. Sidhu and Sneha are having a race with remote controlled cars. Whoever runs
the car faster is the winner. Write a program to accept the distance travelled and the
time for which the car was run by both Sidhu and Sneha. Calculate the speed of the
cars and declare the winner.

Program:

d1 = float(input("Enter distance covered by Sidhu's car"))

t1 = float(input("Enter time taken by Sidhu's car"))

d2 = float(input("Enter distance covered by Sneha's car"))

t2 = float(input("Enter time taken by Sneha's car"))

s1 = d1/t1

s2 = d2/t2

if s1 > s2 :

print("Sidhu's car is faster. He has won the race")

else:

print("Sneha's car is faster. She has won the race")

Output:

Enter distance covered by Sidhu's car12

Enter time taken by Sidhu's car3

Enter distance covered by Sneha's car18

Enter time taken by Sneha's car4

Sneha's car is faster. She has won the race.


7. A school has the following rules for grading performance of the student.

Below 25 marks - Grade F

25 to 40 marks - Grade E

41 to 50 marks - Grade D

51 to 60 marks - Grade C

61 to 80 marks - Grade B

Above 80 marks - Grade A

Ask user to enter marks of AI, Maths and Science. Calculate the average and print
the corresponding grade.

Program:

maths=int(input("Enter marks in Maths "))

science=int(input("Enter marks in Science "))

ai=int(input("Enter marks in AI "))

#Calculate Average marks

average = (maths + science + ai)/3

#Assign appropriate grade

if average > 80:

grade = 'A'

elif average > 60:

grade = 'B'

elif average > 50:

grade = 'C'

elif average > 40:

grade = 'D'

elif average > 25:

grade = 'E'

else:
grade = 'F'

print("Average marks of the student is : ",average)

print("Grade of the student is : ",grade)

Output:

Enter marks in Maths 80

Enter marks in Science 75

Enter marks in AI 85

Average marks of the student is : 80.0

Grade of the student is : B


8. An online shopping portal gives a discount of 10% if the user shops for more than
Rs.10000 and 8% if the user shops for more than Rs. 8000. There are no discounts
for other cases. Write a program to accept the amount for which a user has shopped
and print the discount percentage, discount amount and the amount payable by the
user.

Program:

amount =int(input("Enter the amount: "))

discount = 0

if amount >10000:

print("Discount is 10%")

discount = amount * 10/100

elif amount > 8000:

print("Discount is 8%")

discount = amount * 8/100

else:

print("No discount")

print("Discount Amount is : Rs.",discount)

print("Amount payable is : Rs.",amount-discount)

Output:

Enter the amount: 8500

Discount is 8%

Discount Amount is : Rs. 680.0

Amount payable is : Rs. 7820.0


9. Write a program to check whether a number is a multiple of 6 and 8.

Program:

n=int(input("Enter a number"))

if n%6==0 and n%8==0:

print("Number is a multiple of 6 and 8")

else:

print("Number is not a multiple of 6 and 8")

Output:

Enter a number24

Number is a multiple of both 6 and 8

10. In a game of dice, you bet some money. If the dice shows 2 or 4, you win twice
the money. If the dice shows 1 or 6, you win 6 times the money and if the dice shows
any other number, you lose all the money. Write a program to accept the money you
bet and the number shown on rolling the dice. Display whether you win or lose and
the money you will get back.

Program:

money=float(input('Enter the money you bet'))

n=int(input('Enter number shown in the die'))

if n==2 or n==4:

print("You win..Your prize money is Rs.",money*2)

elif n==1 or n==6:

print("You win.. Your prize money is Rs.",money*6)

else:

print("You lose.. ")

Output:

Enter the money you bet2000

Enter number shown in the die6

You win.. Your prize money is Rs. 12000.0

You might also like