CUET Exam  >  CUET Tests  >  Computer Science: CUET Mock Test - 5 - CUET MCQ

Computer Science: CUET Mock Test - 5 - CUET MCQ


Test Description

30 Questions MCQ Test - Computer Science: CUET Mock Test - 5

Computer Science: CUET Mock Test - 5 for CUET 2024 is part of CUET preparation. The Computer Science: CUET Mock Test - 5 questions and answers have been prepared according to the CUET exam syllabus.The Computer Science: CUET Mock Test - 5 MCQs are made for CUET 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Computer Science: CUET Mock Test - 5 below.
Solutions of Computer Science: CUET Mock Test - 5 questions in English are available as part of our course for CUET & Computer Science: CUET Mock Test - 5 solutions in Hindi for CUET course. Download more important topics, notes, lectures and mock test series for CUET Exam by signing up for free. Attempt Computer Science: CUET Mock Test - 5 | 40 questions in 45 minutes | Mock test for CUET preparation | Free important questions MCQ to study for CUET Exam | Download free PDF with solutions
Computer Science: CUET Mock Test - 5 - Question 1

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

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 1

In Python, we use the hash symbol # to write a single-line comment.

Computer Science: CUET Mock Test - 5 - Question 2

Which of the following is the correct extension of the Python file?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 2

" .py " is the correct extension of the Python file.
.PY file is a program or script written in Python, which is an interpreted object-oriented programming language. It may be written in a text editor and may be edited, but it must be run using a Python interpreter. .PY files are often used to program web servers and other administrative computer systems.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Computer Science: CUET Mock Test - 5 - Question 3

Two statements are given below, one is Assertion (A) and the other is Reason (R). Read the statements carefully and choose the correct answer.

Assertion (A): Linear search is an efficient searching algorithm for large arrays.
Reason (R): Linear search has a time complexity of O(n).

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 3

Linear search has a time complexity of O(n), which means that it takes linear time to search an array. This makes it inefficient for large arrays, as the time taken to search the array grows linearly with the size of the array. Therefore, whether linear search is a simple and easy-to-implement algorithm, it is not efficient for large arrays.

Computer Science: CUET Mock Test - 5 - Question 4

Which language is used to access and manipulate databases?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 4

SQL stands for Structured Query Language. It lets you access and manipulate databases and became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987.

Computer Science: CUET Mock Test - 5 - Question 5

Directions: Match the contents under List I with those under List II.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 5

Primary key is a key that uniquely identifies each record in a table.
Foreign key is used to establish a relationship between two tables.
Candidate key can be used as a primary key and is unique for each record.
Composite key is composed of two or more columns and is used to uniquely identify each record in a table.

Computer Science: CUET Mock Test - 5 - Question 6

A node that forwards data packets from one network to their destination in another network is called:

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 6

A router is a networking device that forwards data packets between computer networks. Routers perform the traffic directing functions on the Internet. Data sent through the internet, such as a web page or email, is in the form of data packets.

Computer Science: CUET Mock Test - 5 - Question 7

Which of the following options can be used to read the first line of a text file Myfile.txt?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 7

The 'readline()' function can be used to read the first line of a text file Myfile. txt. Hence, the correct answer is option 3.

Computer Science: CUET Mock Test - 5 - Question 8

If we want to add more contents in an existing file, file must be opened in............mode.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 8

The "a" mode allows you to open a file to append some content to it. If we want to add a new line to it, we can open it using the "a" mode (append) and then, call the write() method, passing the content that we want to append as argument.

Computer Science: CUET Mock Test - 5 - Question 9

Two statements are given below:

Statement I: ALTER TABLE statement is used to add a new column to an existing table in SQL.
Statement II: INSERT Row statement is used to insert the Row to an existing table in SQL.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 9

ALTER TABLE statement is used to add a new column to an existing table in SQL. INSERT ROW statement is not used to insert the Row to an existing table in SQL. INSERT INTO is used to insert the Row.

Computer Science: CUET Mock Test - 5 - Question 10

It is possible to create a loop using goto statement in python?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 10

No, Python does not support labels and goto. It's a (highly) structured programming language.

Computer Science: CUET Mock Test - 5 - Question 11

What will be the output of following Python code?

str1="Information"
print(str1[2:8])

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 11

Concept of slicing is used in this question. In string slicing, the output is the substring starting from the first given index position i.e. 2 to one less than the second given index position i.e. (8 - 1 = 7) of the given string str1. Hence, the output will be "format".

Computer Science: CUET Mock Test - 5 - Question 12

The process of identifying a slot for the second and further items in the hash table in the event of collision, is called _______.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 12

The process of identifying a slot for the second and further items in the hash table in the event of collision, is called collision resolution.

Computer Science: CUET Mock Test - 5 - Question 13

Which of the following is/are the advantage(s) of a database management system?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 13

Yes, All (1), (2) and (3) are the advantages of a database management system.

Computer Science: CUET Mock Test - 5 - Question 14

Directions: Match the contents under List I with those under List II.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 14

The binary heap data structure takes O(n) time to build, and the repeated extraction and placement operations take O(log n) time. Hence, the total worst-case time complexity of Heap Sort is O(n log n).

  • Selection Sort: O(n2) - This occurs when the array is in reverse sorted order or any other order, as the algorithm has to traverse the entire array to find the minimum element repeatedly.
  • Radix Sort: O(nk), where n is the size of the array and k is the number of digits in the largest number.
  • Count Sort: O(n+k), where n is the number of elements to be sorted, and k is the range of input values.
Computer Science: CUET Mock Test - 5 - Question 15

What is the output of the following if statement

a, b = 12, 5
if a + b:
print('True')
else:
print('False')

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 15

In Python, any non-zero value is considered True. So, it will evaluate to true.

Computer Science: CUET Mock Test - 5 - Question 16

Your teacher has given you a method/function FilterWords() in python which read lines from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks so that the code would run to find desired result. Do the needful with the following python code:

def FilterWords():
c=0
file=open('NewsLetter.TXT', '_____') #Statement-1
line = file._____ #Statement-2
word = _____ #Statement-3
for c in word:
if _____: #Statement-4
print(c)
_________ #Statement-5

FilterWords()

Q. Write the mode of opening the file in Statement-1.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 16

r mode is used to open the file.
'NewsLetter.TXT'. It opens a file in reading mode.

Computer Science: CUET Mock Test - 5 - Question 17

Your teacher has given you a method/function FilterWords() in python which read lines from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks so that the code would run to find desired result. Do the needful with the following python code:

def FilterWords():
c=0
file=open('NewsLetter.TXT', '_____') #Statement-1
line = file._____ #Statement-2
word = _____ #Statement-3
for c in word:
if _____: #Statement-4
print(c)
_________ #Statement-5

FilterWords()

Q. Fill in the blank in Statement-3 to read data word by word.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 17

line.split( ) method fits the blank in Statement-3 to read data word by word.

Computer Science: CUET Mock Test - 5 - Question 18

Your teacher has given you a method/function FilterWords() in python which read lines from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks so that the code would run to find desired result. Do the needful with the following python code:

def FilterWords():
c=0
file=open('NewsLetter.TXT', '_____') #Statement-1
line = file._____ #Statement-2
word = _____ #Statement-3
for c in word:
if _____: #Statement-4
print(c)
_________ #Statement-5

FilterWords()

Q. Fill in the blank in Statement-5 to close the file.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 18

file.close( ) is used to close the file. It is important to close the file as soon as you have finished your work with the file.

Computer Science: CUET Mock Test - 5 - Question 19

Your teacher has given you a method/function FilterWords() in python which read lines from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks so that the code would run to find desired result. Do the needful with the following python code:

def FilterWords():
c=0
file=open('NewsLetter.TXT', '_____') #Statement-1
line = file._____ #Statement-2
word = _____ #Statement-3
for c in word:
if _____: #Statement-4
print(c)
_________ #Statement-5

FilterWords()

Q. Fill in the blank in Statement-2 to read the data from the file.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 19

file.read( ) is fits the blank in Statement-2 as this method returns a string containing all characters in a file.

Computer Science: CUET Mock Test - 5 - Question 20

Your teacher has given you a method/function FilterWords() in python which read lines from a text file NewsLetter.TXT, and display those words, which are lesser than 4 characters. Your teachers intentionally kept few blanks in between the code and asked you to fill the blanks so that the code would run to find desired result. Do the needful with the following python code:

def FilterWords():
c=0
file=open('NewsLetter.TXT', '_____') #Statement-1
line = file._____ #Statement-2
word = _____ #Statement-3
for c in word:
if _____: #Statement-4
print(c)
_________ #Statement-5

FilterWords()

Q. Fill in the blank in Statement-4, which displays the word having lesser than 4 characters.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 20

len(c)<4 is used fits the blank in Statement-4, which displays the word having lesser than 4 characters.

Computer Science: CUET Mock Test - 5 - Question 21

Bandwidth of a channel can be described as:

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 21

Concept:
The range of frequencies available for data transmission is known as Bandwidth. It is also the amount of data that can be transmitted in a fixed amount of time.

  • The bandwidth of digital equipment is commonly measured in bits per second or bytes per second. The bandwidth of analog devices is measured in cycles per second, or HZ.
  • Digital bandwidth, or simply bandwidth, is the quantity of data that can be transported from one point to another in a given length of time in computer networks and computer science.
  • The range of frequencies filled by a modulated radio-frequency signal is known as bandwidth in electronics, and it is commonly expressed in hertz or as a percentage of the radio frequency.
  • The effective bandwidth multiplied by the frequency reuse factor equals the channel bandwidth, where the effective bandwidth is the operating bandwidth correctly scaled by the uplink/downlink ratio.
  • The main distinction between the two is that frequency refers to the rate at which a radio signal sends and receives communication signals, whereas bandwidth refers to the difference between the signal's highest and lowest frequencies.
Computer Science: CUET Mock Test - 5 - Question 22

Which of the following is not an SQL command?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 22

SQL commands are just that: commands. It's used to send and receive data from the database. It can also be used to carry out specific activities, functions, and data queries.

Here are some commands that come under DDL:

  • CREATE
  • ALTER
  • DROP
  • TRUNCATE
Computer Science: CUET Mock Test - 5 - Question 23

Which technique is used to restore a database up to the last consistent state after a system failure?
A. Backup
B. Recovery

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 23

In the event of a failure, database recovery is the process of restoring the database to a correct (consistent) state.

Three states of database recovery:

  • Pre-condition: At any given point in time the database is in a consistent state.
  • Condition: Occurs the same kind of system failure.
  • Post-condition: Restore the database to the consistent state that existed before the failure.
Computer Science: CUET Mock Test - 5 - Question 24

What will be the output for the following python code statements, respectively?

print("Hello world")
print('Hello world')
print('\"Hello world')

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 24

The correct answer is option 3.

Concept:
print() method:

The print() method outputs the message supplied to the screen or another standard output device. The message can be a string or any other object, which will be transformed into a string before being displayed on the screen.

Syntax:
print(object(s), sep=separator, end=end, file=file, flush=flush)

Explanation:
The given python code is,
print("Hello world"):
The print function prints the data which are there in double-quotes and give the output is Hello world.
print('Hello world'):
The print function prints the data which are there in single quotes and gives the output is Hello world. And python accepts either double quotes or single quotes.
print('\"Hello world'):
The print function prints the data which are there in single quotes and gives the output as "Hello world. \ back ward slash emits after the single or double quotes in the print function.
Hence the correct answer is 
Hello world
Hello world
"Hello world

Computer Science: CUET Mock Test - 5 - Question 25

Consider the following python program with the given list a=[5,2,9,8,16,3,1] as input. What does the following program do?

#consider stack is already implemented for you and has predefined pop and push method.

s=stack()  

for item in a:

        if item%2 != 0:

                s.push(item)

max=0

while( len(s)>0 ):

        temp=s.pop()

        if max<temp:

                max=temp

print(max)

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 25

The correct option is ​Prints the largest odd number in the stack = 9

CONCEPT:
Stack is a data structure that follows last in first out order for insertion and deletion of items.
The insertion and deletion of items take place from one end only using the top pointer.

EXPLANATION:
In the above program, items of the list "a" are pushed into stack "s" if they satisfied the if condition i.e. item%2 !=0. 
Which will push only odd items of the list onto stack "s".
The content in the stack will be as follows:


Stack "s"
Now items of the stack are popped one by one in the while loop (till the stack has some item in it) and compared with the max variable 
#iteration 1 : temp = s.pop() = 1
                     here max < temp, Thus new max = 1.
#iteration 2 : temp = s.pop() = 3
                     here max < temp, Thus new max = 3.
#iteration 3 : temp = s.pop() = 9
                     here max < temp, Thus new max = 9.
#iteration 4 : temp = s.pop() = 5
                     here max > temp, Thus if block does not executes 
Hence max = 9.
The final value of max = 9 will be printed in the end which is the largest odd number in the stack = 9.

Computer Science: CUET Mock Test - 5 - Question 26

Which chart element is utilized to identify data series by its color patterns?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 26

The correct answer is option D.

Concept: 
Legend chart element is utilized to identify data series by their color patterns. Legend depicts the colors, patterns, or symbols assigned to the data series. It helps to differentiate the data.
A legend is a portion that describes the graph's components. There is a method in the matplotlib package called legend() that is used to place a legend on the axes. The property Loc in legend() is used to indicate the legend's placement. loc="best" is the default value (upper left).

Syntax:
matplotlib.pyplot.legend([“blue”, “green”], bbox_to_anchor=(0.75, 1.15), ncol=2)
Hence the correct answer is Legend.

Computer Science: CUET Mock Test - 5 - Question 27

Which of the following is the correct syntax to define Series?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 27
  • Series() is a function of the Pandas library that can be used for creating a series.
  • A function is always used with the dot(.) operator. We cannot use hyphen(-) to use a function of a library.
  • Pandas is a library, and not a function by itself. Hence it cannot be followed by a set of round brackets.
  • Pandas does not contain any sub-library and the Series() function is directly included in the Pandas library.
Computer Science: CUET Mock Test - 5 - Question 28

 The given array is a = {7,8,9,6,5}. The number of iterations in selection sort and bubble sort respectively are __________.

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 28

The selection sort algorithm sorts an array by repeatedly finding the minimum element from the unsorted part and putting it at the beginning.So, Every pass 1 swap minimum is required.
The selection sort is good for swapping purposes.

According to the question , the array is {7,8,9,6,5}
Applying selection sort :
1st pass - 5 {7,8,9,6} 
2nd pass - 5, 6 {7,8,9} 

3rd pass - 5, 6, 7 {8,9}

4th pass - 5,6,7,8 {9} ( array sorted)
So, we need 4 passes/iterations to sort the array using selection sort.


Bubble sort work by the principle of finding the max element from the array and pushing it to the end.
Applying bubble sort on {7,8,9,6,5}
1st pass- {7,8,6,5} 9 
2nd pass - {7,6,5}  8, 9
3rd pass- {6,5} 7, 8, 9
4th pass - {5} 6, 7, 8, 9 ( array sorted )
So, we need 4 passes to sort the array using bubble sort.
Both selection and bubble sort takes (n-1) passes / iteration to sort the array. 

Computer Science: CUET Mock Test - 5 - Question 29

How many passes are required for sorting 8 elements list using bubble sort?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 29

Bubble Sort is one of the simplest sorting algorithms which works by repeatedly swapping the adjacent elements if they are in the wrong order.
The logic of working- Greatest element of the list will be at the end after the 1st pass.
Compare with the neighbors, if greater then swap it.
Let's take a simple example to understand it better.
Example:
No. of element = 8(70,25,10,75,80,85,90,15)
1st pass - {70,25,10,75,80,85,15} 90 = 7 comparison
2nd pass - {70,25,10,75,80,15} 85,90 = 6 comparison 
3rd pass - {70,25,10,75,15} 80,85,90 = 5 comparison
4th pass- {70,25,10,15}75,80,85,90= 4 comparison
5th pass- {25,10,15}70,75,80,85,90 = 3 comparison
6th pass- {10,15}25,70,75,80,85,90= 2 comparison
7th pass- {10}15,25,70,75,80,85,90 = 1 comparison  (Element list sorted)

So, we need 7 pass to sort 8 element list by bubble sort.(option 4)
FORMULA-  if the number of an element is n, then we need (n-1) passes to sort the element list. 

Computer Science: CUET Mock Test - 5 - Question 30

Which of the following is the correct function to delete a file in python?

Detailed Solution for Computer Science: CUET Mock Test - 5 - Question 30

The correct answer is option C.

Concept:
remove() method:

remove() method in Python can be used to remove files and the os. rmdir() method can be used to delete an empty folder. The shutil.rmtree() method can be used to delete a folder along with all of its files.
This function accepts a single input, which should be a string with the path to the file to be deleted.
If the specified file doesn’t exist a FileNotFoundError error is thrown. If the given path points to a directory, it will throw an IsADirectoryError error.
Example:
Remove the file "testbook.txt":
import os
os.remove("testbook.txt")

Example:
Remove a file from some specific folder is "c:\temp\testboo\python\myfolder":
import os
os.rmdir("c:\temp\testboo\python\myfolder")
Hence the correct answer is remove('file_path').

View more questions
Information about Computer Science: CUET Mock Test - 5 Page
In this test you can find the Exam questions for Computer Science: CUET Mock Test - 5 solved & explained in the simplest way possible. Besides giving Questions and answers for Computer Science: CUET Mock Test - 5, EduRev gives you an ample number of Online tests for practice

Top Courses for CUET

Download as PDF

Top Courses for CUET