CLASS 8 - ROBOTICS AND AI (Revised) - 1st Term Paper 2024-25

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

NIRAJ PUBLIC SCHOOL

ST
1 TERM EXAMINATION –SEPTEMBER 2024-25
ROBITICS AND AI
CLASS: 8
TIME: 2 hrs. MARKS:
100

Answers to this paper must be written on the paper provided


separately.
You will NOT be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper only.
Answer ALL questions from SECTION–A and any FOUR questions from
SECTION – B.
The intended marks for questions or parts of questions are given in
brackets [ ].
SECTION A (40 marks)
Attempt all questions from this section

QUESTION NO 1:- [20]


Choose the correct answer and write the correct option:
(I) Which of the following is the valid name for an identifier in Python?

a) TEST#4 b) Rollno c) 9thclass d) else


[Analysis]

(II) What is the name of the operator ** in Python?

a) Exponentiation b) Modulus c) Floor division d)


None [Recall]

(III) Assertion (A): In Python, variables written in lower case letter and
upper-case letter are treated as same

Reason (R): Python is a case sensitive language.

a) Both Assertion (A) and Reason (R) are true and Reason (R) is a
correct

explanation of Assertion (A)

b) Both Assertion (A) and Reason (R) are true and Reason (R) is not
a correct
explanation of Assertion (A)

c) Assertion (A) is false and Reason (R) is true

d) Assertion (A) is true and Reason (R) is false


[Application]

(IV) Assertion (A): Lists can be changed after creation.

Reason (R): Lists are mutable

a) Both A and R are true and R is the correct explanation for A.

b) Both A and R are true and R is not correct explanation for A.

c) A is true but R is false.

d) A is false but R is true.


[Application]

(V) Which of these arithmetic operator will evaluate first?


a) + b) // c) % d) **
[Recall]

(VI) The ____________ function is used to find the data type of the
objects.

a) type( ) b) data( ) c) def( ) d) dtype( )


[Recall]

(VII)What will be output after execution of the following code?


x=True
y=False
z=False
if (x and y and z):
print("YES")
elif (x or y or z):
print("yes")
else:
print("no")
a) yes b) YES c) no d) None of these
[Analysis]

(VIII) Which value type does input( ) return ?


[Recall]
a) boolean b) string c) int d)float

(IX) ______________ operators are used to combine one or more


conditional statements and returns either True or False based on the
evaluation of the conditions. [Recall]

a) logical b) arithmetic c) relational d) Augmented


assignment

(X) What is the value of -11//2?


[Analysis]

a) -5 b)-6 c)5 d)6

(X) Solve the following expression using the operator precedence:


[Analysis]
10 + 20/5 - 3*2
a) 6 b)8 c) 9 d) 7.25
(XII) division by zero error is a

a) syntax error b) logical error c) runtime error d) None


[Recall]

(XIII) _____________ is denoted by an indentation in Python.


[Recall]

a) loop b) statement c)break d)block

(XIV) Witch of the following is a valid relational operator?


[Understanding]

a) != b) and c) + d) +=

(XV) print(not 15<10 or 2**3 >12/3) would result in:


[Analysis]

a)True b) False c) true d) false


(XVI)Which one of the following is the correct extension of the Python
file?

a) .py b) .python c) .p d) None of these


[Recall]

(XVII)Which character is used in Python to make a single line comment?


[Recall]

a) / b) // c) # d)!

(XVIII)Which of the following is not a keyword in Python language?


[Understanding]

a) val b)raise c)try d)with

(XIX)Which of the following assignment will return error?


[Analysis]

a) x = y = z = 89 b) x = 6, y = 8 c) x, y, z = 1, 2, 3
d)None of these

(XX)Which of the following store data in pair?


[Recall]

a) List b) Tuple c) String d)Dictionary

QUESTION NO 2:-
[10x2=20]

(I) How did Python get its name?


[Recall]

(II) a) Write the output of the following code:


[Analysis]

print("hello", "friends", sep="@", end="%")

b) Name the different modes of working in Python.


[Recall]

(III) Write a short note on Boolean data type.


[Recall]

(IV) What will be the output from the code given below:
[Analysis]
p, q, r = 10, 20, 25
q, p, r =q-3, p-5, r-2
print(p, q, r)

(V) a) Write the output of the following code:


[Analysis]

x=["Break a leg", "Good Luck", "Best Wishes"]

print(x)

print(type(x))

b) Write the ASCII values of a to z.


[Recall]

(VI) a) What is the full form of ASCII?


[Recall]

b) Define Keywords? [Recall]

(VII) a) Define tokens?


[Recall]
b) What is the use of Membership operators?
[Recall]
(VIII)Mr. X executes the following program segment and the answer
displayed is an error. Name the type of error. How the program can
be modified to get the correct answer?
[critical thinking]

A=9
S='Universe'
SI=S + A
print(SI)
(IX) Predict the output of the following code:
[Analysis]

a) x= True
y= False
if not x or y:
print("Hi")
else
print("Bye")
b) a = [5, 8, 9]
print(a[2])

(X) Write the difference between / and % operators? Give an example.

[Understanding]

Section-B (60 marks)

Attempt any four questions from this Section. Each question carries 15
marks. The answers in this section should consist

of the programs in either python environment or any program


environment with python as the base.

QUESTION NO 3:-

(I)XYZ shop is offering a discount on a mobile as per given below:


[9 marks]

Price Discount

Less than Rs. 10000 20%

Rs. 10000 to Rs. 50000 30%

Rs. 50000 to Rs. 100000 40%

Above 100000 50%

Write a Python program to accept the price(P) of a mobile from user.


Calculate the

Discount (D) based on the above criteria and print the payable
amount(P-D) after

availing discount.
[Understanding/Application]
(II) Write any 3 rules for naming an identifier. [3
marks]

[Recall ]

(III) Write a program to accept length and breadth of a rectangle and


calculate and print area and perimeter
[3 marks]

Area of Rectangle = length x breadth

Perimeter of Rectangle = 2(length + breadth)

Input: Enter length of the Rectangle: 5

Enter breadth of the Rectangle: 3

Output: Area of the Rectangle: 15

Perimeter of the Rectangle: 30


[Understanding/Application]

QUESTION NO 4:-

(I) Write a program to accept a character and check if it is a vowel or a


consonant
using switch.
[9 marks]

[Understanding/Application]

(II) Write a program to accept marks of a student obtained in 3


different subjects and find the total and average.
[3 marks]

[Understanding/Application]

(III) Write any 3 advantages of Python language.


[3 marks]
[Application]

QUESTION NO 5: -
(I) Write a program to accept a number and print the corresponding
day of the week using if-elif-else. [9
marks]

[Understanding/Application]

(II) Input two numbers and display the bigger of the two numbers.
[3 marks]

Input: Enter first number: 67


[Understanding/Application]

Enter second number: 23

Output: Bigger number: 67

(III) Rewrite the following if-elif-else construct using switch case


[3 marks]

if(var==1):
[Understanding/Application]

print(“good”)

elif(var==2):
print(“better”)
elif(var==3):
print(“best”)
else :
print(“Invalid”)

QUESTION NO 6:-

(I) a) Write a program to accept the three sides of a triangle and print
the type

of the triangle[Scalene/Isosceles/Equilateral]
[6 marks]

(An equilateral triangle has sides that are all equal. An isosceles
triangle has two
sides that are identical. In a scalene triangle, all the sides are equal)
Input: Enter the first side: 5
Enter the second side: 8
Enter the third side: 5
Output: Isosceles triangle
[Understanding/Application]
b) Write a program to accept an angle of a triangle and check if it is
an obtuse angle or acute angle or right angle.
[Understanding/Application] [3 marks]

(II) Write any 3 features of Python language. [3


marks]

(III) Write a Python program that accepts principal(P), rate of


interest(R), time(T) and calculate Compound Interest(CI).
[3 marks]
T
R
CI= P(1+ ) -P [Understanding/Application]
100

QUESTION NO 7:-

(I) Write a menu driven program to find the volume of a sphere and
cylinder based on user’s choice.
[9 marks]
4 3
Volume of Sphere = 3 π r

Volume of Cylinder = π r 2 h
a) Input radius of sphere and find the volume.

Input: Enter radius of sphere : 4

Output: Volume of sphere: 267.94

b) Input radius and height of cylinder and find the volume.

Input: Enter radius of cylinder : 3

Enter height of cylinder: 5

Output: Volume of cylinder: 141.29


[Understanding/Application]
(II) Write a program to accept 2 numbers and swap their values.
[3 marks]

[Understanding/Application]

(III) Write a program to accept a number and check if it is even or odd.


[3 marks]

[Understanding/Application]

QUESTION NO 8:-

(I) Write a program to accept name and basic salary of an employee


and calculate annual salary based on the following conditions. If the
Annual salary exceeds Rs. 1,80,000 then print “income tax to be paid”
otherwise “no income tax” [9 marks]

DA= 30% of basicsalary

HRA= 15% of basicsalary

GrossSalary= basicsalary+DA+HRA

Annualsalary=12*GrossSalary
[Understanding/Application]

(II) Write a Python program to convert Celsius to Fahrenheit using the


formula:

(Celsius *1.8) + 32
[3 marks]

Input: Enter Celsius value: 37


[Understanding/Application]

Output: Fahrenheit value: 98.6

(III) Write a program to accept distance in meters from user and


convert to centimeters.

Input: 24m
[Understanding/Application]

Output: 2400m [3 marks]

You might also like