Back to the full dot-point answer
EnglandComputer ScienceQuick questions
2.2 Programming fundamentals
Quick questions on String manipulation and file handling - OCR GCSE Computer Science J277
4short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is not closing the file?Show answer
Leaving a file open can lock it and lose unsaved data; always .close() when done.
What is q1?Show answer
State the result of "Computer".length and "Computer".substring(0,4). [2 marks]
What is q2?Show answer
Write a line that joins firstName and surname into fullName with a space between. [1 mark]
What is q3?Show answer
State one reason a program should close a file after using it. [1 mark]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.