0% found this document useful (0 votes)
4 views

CS SOLUTION

Uploaded by

Harsh Verdhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CS SOLUTION

Uploaded by

Harsh Verdhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Solution

HALF YEARLY
Class 11 - Computer Science
Section A
1.
(d) Program
Explanation:
Program is a set of instructions that process input, manipulate data, and output a result.
2.
(c) Interpreter
Explanation:
Interpreter
3.
(b) Windows
Explanation:
Windows
4.
(d) (X+Y) (Y+Z)
Explanation:
((X+Y)' + (Y+Z)')'
= ((X+Y)')’. ((Y+ Z)’)’ (De Morgan's theorem)
= (X+Y) . (Y+ Z) (Involution law)
5.
(c) (378)8
Explanation:
In octal number systems 0-7 digits are used.
6. (a) Extended ASCII
Explanation:
Extended ASCII
7. (a) All of these
Explanation:
All of these
8.
(b) Numbers
Explanation:
Numbers
9.
(c) Debugger
Explanation:
Debugger
10. (a) pass
Explanation:
The pass statement is used as a placeholder for future code. When the pass statement is
executed, nothing happens, but you avoid getting an error when empty code is not
allowed.
11. (a) if-else
Explanation:
if-else
12.
(b) statements
Explanation:
statements
13.
(d) Compound statement
Explanation:
Compound statement
14.
(b) :
Explanation:
The slice operator [n:m] returns the part of the string starting with the character at index n
and go up to but not including the character at index m.
15.
(b) both double and single quotes
Explanation:
both double and single quotes
16. (a) extend()
Explanation:
The extend() method increases the length of the list by the number of elements that are
provided to the method, so if you want to add multiple elements to the list, you can use
this method.
17.
(d) 0
Explanation:
0
Section B
18. (a) Both A and R are true and R is the correct explanation of A.
Explanation:
Both A and R are true and R is the correct explanation of A.
19. (a) Both A and R are true and R is the correct explanation of A.
Explanation:
Both A and R are true and R is the correct explanation of A.
Section C
20. Virtual memory typically comes into action when applications are too large for the RAM to
handle. The operating system uses the hard drive to temporarily store information and take
it back when needed. This is normally a lot slower than actual RAM and can degrade the
performance if used too heavily.
21. An Operating System (OS) is an interface between a computer user and computer
hardware. An operating system is a software which performs all the basic tasks like file
management, memory management, process management, handling input and output, and
controlling peripheral devices such as disk drives and printers.
Some popular Operating Systems include Linux Operating System, Windows Operating
System, VMS, OS/400, AIX, z/OS, etc.
22. a. To hide details of hardware by creating abstraction: An abstraction is software that
hides lower level details and provides a set of higher-level functions.
b. To allocate resources to processes (manage resources): An operating system controls
how princesses (the active agents) may access resources (passive entities).
c. Provide a pleasant and effective user interface: The user interacts with the operating
systems through the user interface and usually interested in the "look and feel" of the
operating system.
23. Principle of duality: Duality principle states that if a boolean relation holds true then its
dual relation derived by:
i. Changing each OR sign (+) to an AND sign (-).
ii. Changing each AND sign (⋅) to an OR sign (+)
Also holds true.
Example: Take the expression
A⋅ (B+C) = A⋅B + A⋅C
Its dual will be
A + (B⋅C) = (A+B)(A+C)
which is also true as it is a postulate of Boolean algebra.
Importance in Boolean Algebra: The principle of duality is an important concept in Boolean
algebra, particularly in proving various theorems. The principle of duality is used
extensively in proving Boolean algebra theorem. Once we prove that an expression is valid,
then by the principle of duality, its dual is also valid. Hence, our effort in proving various
theorems is reduced to half.
24. 1100101.101102
= 1 × 26 + 1 × 25 + 0 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 + 1 × 2-1 + 0 × 2-2 + 1 × 2-3 +
1 × 2-4
= 64 + 32 + 0 + 0 + 4 + 0 + 1 + 0.5 + 0 + 0 + 0.125 + 0.0625 + 0
= 101.687510
25. Connectors are flowchart symbols that are used to connect two different parts of a
flowchart.
26. i : 10
j : 15
k : 13.0
l : 17.0
m : 8.0
n : 149.0
27. a = float(input("Enter first angle: ")) b = float(input("Enter second angle: ")) c =
float(input("Enter third angle: ")) sum = a + b + c if sum == 180: print("These angles will
make a triangle") else: print("These angles will not make a triangle")
Output
Enter first angle : 45.6
Enter second angle : 44.4
Enter third angle : 90.0
These angles will make a triangle
28. amt = float(input("Enter the amount to be paid: "))
if amt > 5000:
dis=5
else:
dis=0
famt = amt - (amt * dis / 100)
print("Discount given is", dis, "%")
print("Final amount to be paid is", famt)
29. print("Enter marks obtained in 5 subjects:")
mark1 = int(input())
mark2 = int(input())
mark3 = int(input())
mark4 = int(input())
mark5 = int(input())
sum = mark1 + mark2 + mark3 + mark4 + mark5
average = sum / 5
print("Total of marks:", sum)
print("Average:", average)
if average >= 91 and average <= 100:
print("Your Grade is A+")
elif average >= 81 and average <= 90:
print("Your Grade is A")
elif average >= 71 and average <= 80:
print("Your Grade is B+")
elif average >= 61 and average <= 70:
print("Your Grade is B")
elif average >= 51 and average <= 60:
print("Your Grade is C+")
elif average >= 41 and average <= 50:
print("Your Grade is C")
elif average >= 0 and average <= 40:
print("Your Grade is F")
else:
print("Strange Grade..!!")
30. The Python statements are:
a. sub[-3:]
b. sub.find('ute')
c. 'enc' in sub
d. sub*4
31. str1 = input("Enter a string:")
word = str1.split()
maxlength = 0
maxword = ""
for i in word:
x = len(i)
if x > maxlength and i.isalpha() == True:
maxlength = x
maxword = i
print("Substring with maximum length is:", maxword)
32. i. swapcase( ) method is used to invert case for all letters in string.
Syntax string.swapcase()
ii. split() method splits according to delimiter string and returns list of substrings; split into
at most num substrings if given.
Syntax string.split(‘‘delimiter’’, num)
iii. replace() method replaces all occurrences of old in string with new or at most max
occurrence if max given.
Syntax string.replace (old, new[, max])
iv. startswith() determines if string or a substring of string starts with substring; returns
True if so and false otherwise.
Syntax string.startswith(str, beg =0, end = len (string))
v. zfill() method returns original string left padded with zeroes to a total of width
characters; intended for numbers.
Syntax string.zfill(width)
vi. rstrip() removes all trailling whitespace of string.
Syntax string.rstrip()
vii. lower() method converts all uppercase letters in string to lowercase.
Syntax string.lower()
viii. index() method returns the lower index of the substring if it is found in the given string. If
it is not found, then it gives error.
Syntax string.index(substring,start,end)
33. [['a', 'b', 67'], [0,1,2,67], [23,45,67,89]]
34. print("Maximum of 4,12,43.3,19 and 100 is: ",end="") print (max( 4,12,43.3,19,100))
print("Minimum of 4,12,43.3,19 and 100 is: ",end="") print (min( 4,12,43.3,19,100))
35. # Function to calculate average marks of n students
def computeAverage(list1, n):
# Initialize total
total = 0
for marks in list1:
# Add marks to total
total = total + marks
average = total / n
return average
# Create an empty list
list1 = []
print("How many students marks you want to enter:")
n = int(input())
for i in range(0, n):
print("Enter marks of student", (i + 1), ":")
marks = int(input())
# Append marks in the list
list1.append(marks)
average = computeAverage(list1, n)
print("Average marks of", n, "students is:", average)

Output:
How many students marks you want to enter : 5
Enter marks of student 1 : 45
Enter marks of student 2 : 89
Enter marks of student 3 : 79
Enter marks of student 4 : 76
Enter marks of student 1 : 55
Average marks of 5 students is : 68.8
Section D
36. Variable
37. Rvalue
38. Whole number, sequence of characters, single, character
39. =
40. n
41. n%2
42. 0
43. else:

You might also like