This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 6 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 6 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What is serialization in the context of binary files? A) Converting a Python object to a byte stream. B) Reading data from a file. C) Writing text to a file. D) Converting a byte stream to a Python object. Show Answer Correct Answer: A) Converting a Python object to a byte stream. 2. Apa yang dilakukan fscanf? A) Menulis data terformat ke file. B) Membaca data terformat dari file. C) Menutup file. D) Membuka file. Show Answer Correct Answer: B) Membaca data terformat dari file. 3. Which of the following file types allows to store large data files in the computer memory? A) Text Files. B) Binary Files. C) CSV Files. D) None of these. Show Answer Correct Answer: B) Binary Files. 4. What is used to remove the newline character when reading from a file? A) .strip(). B) .delete(). C) .remove(). D) .cut(). Show Answer Correct Answer: A) .strip(). 5. What is the function of 'seek()' in file handling? A) The 'seek()' function changes the current position of the file pointer. B) The 'seek()' function closes the file after use. C) The 'seek()' function reads data from the file. D) The 'seek()' function writes data to the file. Show Answer Correct Answer: A) The 'seek()' function changes the current position of the file pointer. 6. If you will have to store marks of 10 students then which python datatype will you use? A) Dictionary. B) Set. C) List. D) String. Show Answer Correct Answer: A) Dictionary. 7. What is the purpose of 'fileP.write(str(i) + '' ")' in the loop? A) To read data from a file. B) To write each prime number followed by a space to the file. C) To delete data from a file. D) To append data to a file. Show Answer Correct Answer: B) To write each prime number followed by a space to the file. 8. Which class is used to write text to a file in Java? A) FileReader. B) Scanner. C) FileWriter. D) BufferedReader. Show Answer Correct Answer: C) FileWriter. 9. Which header file must be included to use file I/O operations in C++? A) . B) . C) . D) . Show Answer Correct Answer: A) . 10. Which of the following file types is typically a text file? A) .exe. B) .mp3. C) .txt. D) .jpg. Show Answer Correct Answer: C) .txt. 11. Which superglobal variable holds information about headers, paths, and script locations? A) $ GLOBALS. B) $ SERVER. C) $ SESSION. D) None. Show Answer Correct Answer: B) $ SERVER. 12. Which function is used to read the data from a binary file? A) Pickle.dump(). B) Pickle.load(). C) Pickle.read(). D) Pickle.readlines(). Show Answer Correct Answer: B) Pickle.load(). 13. How can you read binary data from a file? A) Use 'open(filename, 'rb')' to read binary data from a file. B) Employ 'load(filename, 'rb')' to retrieve binary content. C) Use 'read(filename, 'b')' to access binary data. D) Open the file with 'open(filename, 'text')' for binary read. Show Answer Correct Answer: A) Use 'open(filename, 'rb')' to read binary data from a file. 14. What is the parent class of All Exceptions in JAVA A) Throw. B) Exception. C) Error. D) Bug. Show Answer Correct Answer: A) Throw. 15. If a file exists, then it deletes the file content prior to its opening. A) Ios::ate. B) Ios::in. C) Ios::out. D) Ios::app. E) Ios::trunc. Show Answer Correct Answer: E) Ios::trunc. 16. How can you move the file pointer to the beginning of a file? A) Use the read method to access the file. B) Close the file and reopen it. C) Use the tell method to check the position. D) Use the seek method with an offset of 0. Show Answer Correct Answer: D) Use the seek method with an offset of 0. 17. What is the purpose of the 'flush()' method when working with files? A) It forces the write buffer to be flushed to the file. B) It clears the file contents. C) It reads the file contents into memory. D) It closes the file immediately. Show Answer Correct Answer: A) It forces the write buffer to be flushed to the file. 18. SequenceInputStream class is used to read data from ..... A) Multilevel Streams. B) Single Stream. C) Multiple streams. D) None of given. Show Answer Correct Answer: C) Multiple streams. 19. Which is an advantage of CSV over text file? A) Easier for tabular data exchange. B) Can store Python objects. C) Faster than binary. D) Stores images directly. Show Answer Correct Answer: A) Easier for tabular data exchange. 20. What will this line of code do?myFile = open("test ..... scores.txt", "w") A) Opens the text file 'test scores' in reading mode. B) Opens the text file 'test scores' in writing mode-appends new data to the end of the file. C) Opens the text file 'test scores' in writing mode-overwrites contents. D) Opens the text file 'test scores' in wait mode. Show Answer Correct Answer: C) Opens the text file 'test scores' in writing mode-overwrites contents. 21. Which of these class is not a member class of java.io package? A) FileReader. B) FileWriter. C) File. D) String. Show Answer Correct Answer: D) String. 22. Why should you avoid closing a file according to the document? A) To keep it accessible. B) To save changes. C) To delete it. D) To rename it. Show Answer Correct Answer: A) To keep it accessible. 23. Which option is correct about this program? f=open( "ss.txt" , "wb" ) print( "Name of the file:" , f.name) f.flush() f.close() A) Compilation error. B) Runtime error. C) No output. D) Flushes the file when closing them. Show Answer Correct Answer: D) Flushes the file when closing them. 24. Text file store information in ..... character A) ASCII. B) EOL. C) UNICODE. D) BOTH 1 & 3. Show Answer Correct Answer: A) ASCII. 25. Which of the following modes is used for both writing and reading from a binary file? A) Wb+. B) W. C) Wb. D) W+. Show Answer Correct Answer: A) Wb+. ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 6 File Handling Quiz 1Class 11 Computer Science Chapter 6 File Handling Quiz 2Class 11 Computer Science Chapter 6 File Handling Quiz 3Class 11 Computer Science Chapter 6 File Handling Quiz 4Class 11 Computer Science Chapter 6 File Handling Quiz 5Class 11 Computer Science Chapter 6 File Handling Quiz 7Class 11 Computer Science Chapter 6 File Handling Quiz 8Class 11 Computer Science Chapter 6 File Handling Quiz 9Class 11 Computer Science Chapter 6 File Handling Quiz 10Class 11 Computer Science Chapter 6 File Handling Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books