Class VII Study Material (Ch-4,5,6)
Class VII Study Material (Ch-4,5,6)
1. Write a program to input three numbers and print its average.
(Average= Sum of all the numbers(observations)/No. Of observations).
2. Write a program to input length and breadth of a rectangle and calculate the area and
perimeter.
L=int(input(‘Enter length of rectangle :’))
B=int(input(‘Enter breadth of rectangle:’))
Area=L*B
Perimeter=2*(L+B)
print(‘The Area of rectangle :’,Area)
print(‘The perimeter of the given rectangle :’,Perimeter)
3. Write a program to input the side of a square and calculate the area and perimeter.
5. Write a program to input the price of a commodity and calculate the discount as 25% of
price.
price=int(input('Enter the price of the product'))
discount=price-(0.25*price)
print('Final discounted price is',discount)
6. Write a program to input two numbers and print the largest.
7. Write a program to input a number and find whether the number is even or odd.
9. Write a program to input three numbers and print the smallest.
10.Write a program to input your age and check the eligibility for voting.
age=int(input('Enter your age'))
if age >= 18:
print('You are eligible to vote')
else:
print('You are not eligible to vote')
11.Write a program to input cost price and selling price and check whether there is a profit
or loss.
sp=int(input('Enter the selling price'))
cp=int(input('Enter the cost price'))
if sp>cp:
print('There is a profit of rupees', sp-cp)
else:
print('There is a loss of rupees', cp-sp)
12.Write a program to input your percentage and display the grade obtained as per the below
given table -
Percentage Grade
80 and above A
70 to 79 B
50 to 69 C
33 to 49 D
Below 33 E
a) 100
2.5
-11
11
b) True
True
False
True
False
c)
d) True
False
False
True
True
True
e) True
False
False
True
f)
130
43.3
<class ‘float’>
g) <class ‘int’>
<class ‘float’>
<class ‘str’>
SOLUTIONS TO THE BACK EXERCISES OF THE BOOK