Chapter 11 : Societal Impact | Class 11th | Computer Science Important Questions

NCERT Book Exercise of Class 11 Computer Science


1. After practicals, Atharv left the computer laboratory but forgot to sign off from his email account. Later, his classmate Revaan started using the same computer. He is now logged in as Atharv. He sends inflammatory email messages to few of his classmates using Atharv’s email account. Revaan’s activity is an example of which of the following cyber crime?
Justify your answer.
a) Hacking
b) Identity theft
c) Cyber bullying
d) Plagiarism


Answer: (b) Identity theft

Identity theft means obtaining someone’s credentials to commit some online fraud.


2. Rishika found a crumpled paper under her desk. She picked it up and opened it. It contained some text which was struck off thrice. But she could still figure out easily that the struck off text was the email ID and password of Garvit, her classmate. What is ethically correct for Rishika to do?
a) Inform Garvit so that he may change his password.
b) Give the password of Garvit’s email ID to all other classmates.
c) Use Garvit’s password to access his account.

Answer: a) Inform Garvit so that he may change his password.


3. Suhana is down with fever. So, she decided not to go to school tomorrow. Next day, in the evening she called up her classmate, Shaurya and enquired about the computer class. She also requested him to explain the concept. Shaurya said, “Mam taught us how to use tuples in python”. Further, he generously said, “Give me some time, I will email you the material
which will help you to understand tuples in python”.

Shaurya quickly downloaded a 2-minute clip from the Internet explaining the concept of tuples in python. Using video editor, he added the text “Prepared by Shaurya” in the downloaded video clip. Then, he emailed the modified video clip to Suhana. This act of Shaurya is an example of —
a) Fair use
b) Hacking
c) Copyright infringement
d) Cyber crime

Answer: c) Copyright infringement


4. After a fight with your friend, you did the following activities. Which of these activities is not an example of cyber bullying?

a) You sent an email to your friend with a message saying that “I am sorry”.
b) You sent a threatening message to your friend saying “Do not try to call or talk to me”.
c) You created an embarrassing picture of your friend and uploaded on your account on a social networking site.


Answer: a) You sent an email to your friend with a message saying that “I am sorry”.


5. Sourabh has to prepare a project on “Digital India Initiatives”. He decides to get information from the Internet. He downloads three web pages (webpage 1, webpage 2, webpage 3) containing information on Digital India Initiatives. Which of the following steps taken by Sourabh is an example of plagiarism or copyright infringement? Give justification in support of your answer.
a) He read a paragraph on “ Digital India Initiatives” from webpage 1 and rephrased it in his own words. He finally pasted the rephrased paragraph in his project.
b) He downloaded three images of “ Digital India Initiatives” from webpage 2. He made a collage for his project using these images.
c) He downloaded “Digital India Initiative” icon from web page 3 and pasted it on the front page of his project report.

Answer: b & c

Plagiarism means using someone else’s work without giving adequate citation for use and presenting as your own work.

Copyright infringement means using copyright-protected material without obtaining copyright holder’s permission or without paying for it, if it is being sold.


6. Match the following:

Column AColumn B
PlagiarismFakers, by offering special rewards or money prize asked for personal information, such as bank account information
HackingCopy and paste information from the Internet into your report and then organise it
Credit card fraudThe trail that is created when a person uses the Internet.
Digital Foot PrintBreaking into computers to read private emails and other files

Answer:

Column AColumn B
PlagiarismCopy and paste information from the Internet into your report and then organise it
HackingBreaking into computers to read private emails and other files
Credit card fraudFakers, by offering special rewards or money prize asked for personal information, such as bank account information
Digital Foot PrintThe trail that is created when a person uses the Internet.

7. You got the below shown SMS from your bank querying a recent transaction. Answer the following —

a) Will you SMS your pin number to the given contact number?

Answer : No, I will not shared PIN to that contact number.

b) Will you call the bank helpline number to recheck the validity of the SMS received?

Answer : Yes. I will call the bank helpline number.


8. Preeti celebrated her birthday with her family. She was excited to share the moments with her friend Himanshu. She uploaded selected images of her birthday party on a social networking site so that Himanshu can see them. After few days, Preeti had a fight with Himanshu. Next morning, she deleted her birthday photographs from that social networking site, so that Himanshu cannot access them. Later in the evening, to her surprise, she saw that one of the images which she had already deleted from the social networking site was available with their common friend Gayatri. She hurriedly enquired Gayatri “Where did you get this picture from?”. Gayatri replied “Himanshu forwarded this image few minutes back”.
Help Preeti to get answers for the following questions.

Give justification for your answers so that Preeti can understand it clearly.

a) How could Himanshu access an image which I had already deleted?

Answer: Images loaded on a social networking site can be saved/downloaded or even screenshots may be taken.

b) Can anybody else also access these deleted images?

Answer: Yes, from the digital footprint, government and other agencies can obtain these legally, if needed.

c) Had these images not been deleted from my digital footprint?

Answer: Images deleted from a social website always remain part of a digital footprint.

Read More

Chapter 10 : Tuples and Dictionaries | Class 11th | Computer Science Important Questions

chapter 10. Tuples and Dictionary


1. Consider the following tuples, tuple1 and tuple2:

tuple1 = (23,1,45,67,45,9,55,45)
tuple2 = (100,200)

Find the output of the following statements:

i. print(tuple1.index(45))

Answer: 2

ii. print(tuple1.count(45))

Answer: 3

iii. print(tuple1 + tuple2)

Answer: (23, 1, 45, 67, 45, 9, 55, 45, 100, 200)

iv. print(len(tuple2))

Answer: 2

v. print(max(tuple1))

Answer: 67

vi print(min(tuple1))

Answer: 1

vii. print(sum(tuple2))

Answer: 300

viii. print(sorted(tuple1))

print(tuple1)

Answer: [1, 9, 23, 45, 45, 45, 55, 67]

(23, 1, 45, 67, 45, 9, 55, 45)



2. Consider the following dictionary stateCapital:

stateCapital = {“AndhraPradesh”:”Hyderabad”, “Bihar”:”Patna”, “Maharashtra”:”Mumbai”, “Rajasthan”:”Jaipur”}

Find the output of the following statements:

i. print(stateCapital.get(“Bihar”))

Answer: Patna

ii. print(stateCapital.keys())

Answer: dict_keys([‘Assam’, ‘Bihar’, ‘Maharashtra’, ‘Rajasthan’])

iii. print(stateCapital.values())

Answer: dict_values([‘Guwahati’, ‘Patna’, ‘Mumbai’, ‘Jaipur’])

iv. print(stateCapital.items())

Answer: dict_items([(‘Assam’, ‘Guwahati’), (‘Bihar’, ‘Patna’), (‘Maharashtra’, ‘Mumbai’), (‘Rajasthan’, ‘Jaipur’)])

v. print(len(stateCapital))

Answer: 4

vi. print(“Maharashtra” in stateCapital)

Answer: True

vii. print(stateCapital.get(“Assam”))

Answer: Guwahati

viii. del stateCapital[“Rajasthan”]

print(stateCapital)

Answer: {‘Bihar’: ‘Patna’, ‘Maharashtra’: ‘Mumbai’, ‘Rajasthan’: ‘Jaipur’}


3. “Lists and Tuples are ordered”. Explain.

Answer: Lists and Tuples are ordered, it means that both the lists’ and tuples’ elements are ordered, because each element in lists and tuples has a designated index position. The index position (either forward or backward), maintain the order and these elements can also accessed individually with the help of their index position.

For example :

List1 = [10, 3, ‘mycstutorial.in’, False]

Tuple1 = [25, 12, ‘mycstutorial.in’, True]

print(List1[2])

print(Tuple[3])

Output:

myctutorial.in

True



4. With the help of an example show how can you return more than one value from a function.

Answer: A function can return multiple values in the form of tuples.

For example :

#Example - 1
def square(n1, n2, n3):
    sq = n1**2, n2**2, n3**2
    rerurn sq


#Example - 2
def cube(n1, n2, n3):
    return n1**3, n2**3, n3**3
   
#__main__

print("Calling Method Square")
result1 = square(5,10,15)
print(result1)
print(type(result1))


print("Calling Method Cube")
result2 = cube(2,3,4)
print(result2)
print(type(result2))

Output:

Calling Method Square

(25, 100, 225 )

<class ‘tuple’>

Calling Method Cube

(8, 27, 64)

<class ‘tuple’>


5. What advantages do tuples have over lists?

Answer: The advantages of tuples over lists is that tuples ensure that the data stored in tuple will not change.

If you want to store data as a sequence of any type of values and does not want to make any changes accidently, then you can use Tuple instead of List.


6. When to use tuple or dictionary in Python. Give some examples of programming situations mentioning their usefulness.

Answer: Tuples are used to store the data which is not intended to change during the course of execution of the program. For example, if the name of months is needed in a program, then the same can be stored in the tuple as generally, the names will either be repeated for a loop or referenced sometimes during the execution of the program.

Dictionary is used to represent the unordered list of the data. The key and value are separated by colon. Dictionary is used to store associative data like student’s roll no. and the student’s name. Here, the roll no. will act as a key to find the corresponding student’s name. The position of the data doesn’t matter as the data can easily be searched by using the corresponding key.

For example :

#Tuple vs Dictionary

month = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')

stud = {1: ('Amrit', 'IV','DPS Mgarh'), 2: ('Tanmay', 'III', 'DPS Mgarh')}

print("Name of month 6th : ", month[5])

print("Details of Roll Number 1: ")
print(stud[1])

Output:

Name of month 6th : Jun

Details of Roll Number 1:

(‘Amrit’, ‘IV’, ‘DPS Mgarh’)


7. Prove with the help of an example that the variable is rebuilt in case of immutable data types.

Answer: A tuple once created cannot be changed Even if you try to make changes in the tuple and give it the same name, Python Internally will create a new tuple and store it at a different memory location. For example

>>> tup1 = (1,2,'mycstutorial.in')
>>> id(tup1)
61944840
>>> print(tup1)
(1, 2, 'mycstutorial.in')

>>> tup1 = tup1 + ('ncert solution','xi','computer','science')
>>> tup1
(1, 2, 'mycstutorial.in', 'ncert solution', 'xi', 'computer', 'science')
>>> id(tup1)
59301336
>>> print(tup1)
(1, 2, 'mycstutorial.in', 'ncert solution', 'xi', 'computer', 'science')
>>> 

Check the id printed in two different statement. As you can observe in both cases variable name is the same but it is printed different id’s, It means that tuple is immutable data type, and if you try to change it, it will not make the change in-place, it create a new variable.


8. TypeError occurs while statement 2 is running. Give reason. How can it be corrected?

tuple1 = (5) #statement 1
len(tuple1) #statement 2

Answer: tuple1 = (5) statement does not create a tuple type variable, it creates integer type variable. len() function works with collection/sequence type variable such tuple, list, dictionary, string.

len() function need sequence value or variable as argument. That’s why len(tuple1) generate an error TypeError.

Corrected Way :

tuple1 = (5,) #statement 1
len(tuple1) #statement 2

Output:

1

Read More

Chapter 9 : Lists | Class 11th | Computer Science Important Questions

Class 11 Computer Science – NCERT Book question answers

Chapter 9. Lists


1. What will be the output of the following statements?

i. Find the output

list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)

Answer: [10, 12, 26, 32, 65, 80]

ii. Find the output

list1 = [12,32,65,26,80,10]
sorted(list1)
print(list1)

Answer: [10, 12, 26, 32, 65, 80]

[12, 32, 65, 26, 80, 10]

iii. Find the output

list1 = [1,2,3,4,5,6,7,8,9,10]
list1[::-2]
list1[:3] + list1[3:]

Answer: [10, 8, 6, 4, 2]

[1,2,3,4,5,6,7,8,9,10]

iv. Find the output

list1 = [1,2,3,4,5]
list1[len(list1)-1]

Answer: 5


2. Consider the following list myList. What will be the elements of myList after the following two operations:

myList = [10,20,30,40]
i. myList.append([50,60])
ii. myList.extend([80,90])

Answer: Elements of myList after given operations are (i) [10,20,30,40,[50,60]]

(ii) [10,20,30,40,[50,60], 80,90]


3. What will be the output of the following code segment:

myList = [1,2,3,4,5,6,7,8,9,10]
for i in range(0,len(myList)):
        if i%2 == 0:
             print(myList[i])

Answer: Above code print even positioned element of myList.

1

3

5

7

9


4. What will be the output of the following code segment:

a. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[3:]
print(myList)

Answer: [1, 2, 3]

b. myList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
del myList[:5]
print(myList)

Answer: [6, 7, 8, 9, 10]

c. myList = [1,2,3,4,5,6,7,8,9,10]
del myList[ : : 2]
print(myList)

Answer: [2, 4, 6, 8, 10]


5. Differentiate between append() and extend() functions of list.

Answer: append() vs extend()

1. append() method of list is use to add element at the end of the list.

extend() method of list is use to add a list at the end of another list.

2. append() method increase the size of list by 1 while extend() method increase the size of list by len(list2).

myList = [10,20,30,40]

myList.append([50,60])
print(myList)
myList.extend([80,90])

print(myList)


6. Consider a list:

list1 = [6, 7, 8, 9]

What is the difference between the following operations on list1:

a. list1 * 2
b. list1 *= 2
c. list1 = list1 * 2

Answer: (a) In list1 * 2, * operator work as replication operator. Which replicate the list1 two times. list1 * 2 will generate a list [6, 7, 8, 9, 6, 7, 8, 9]. But list1 is not changed.

(b) list1 *= 2, in this *= is a replication and assignment operator. It means it replicate the list1 two times and update list1. New list1 is [6, 7, 8, 9, 6, 7, 8, 9]

(c) list1 = list1 * 2, this statement will create a new list1 containing the two times replicated value of list1.

Lets understand this with an example.

>>> list1 = [6, 7, 8, 9]
>>> id(list1)
33379432

>>> list1 * 2
[6, 7, 8, 9, 6, 7, 8, 9]
>>> list1
[6, 7, 8, 9]
>>> id(list1)
33379432

>>> list1 *= 2
>>> list1
[6, 7, 8, 9, 6, 7, 8, 9]

>>> id(list1)
33379432

>>> list1 = list1 * 2
>>> list1
[6, 7, 8, 9, 6, 7, 8, 9, 6, 7, 8, 9, 6, 7, 8, 9]

>>> id(list1)
64129512
>>> 

7. The record of a student (Name, Roll No., Marks in five subjects and percentage of marks) is stored in the following list:
stRecord = [‘Raman’,’A-36′,[56,98,99,72,69], 78.8]
Write Python statements to retrieve the following information from the list stRecord.
a) Percentage of the student
b) Marks in the fifth subject
c) Maximum marks of the student
d) Roll no. of the student
e) Change the name of the student from ‘Raman’ to ‘Raghav’

Answer: Statements are –

(a) print(” Percentage of the student : “, stRecord[3])

b) print(“Marks in the fifth subject : “, stRecord[2][4])

c) print(“Maximum marks of the student :”, max(stRecord[2]))

d) print(“Roll no. of the student :”, stRecord[1])

e) stRecord[0] = ‘Raghav

Read More