
Delphi Programming Quiz grade 11
Authored by David Coetzer
Information Technology (IT)
11th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which property of the TRichEdit component is used to align the paragraph?
Paragraph.Alignment
Paragraph.Tab[Index]
Paragraph.TabCount
Paragraph.Numbering
Answer explanation
The correct property to align paragraphs in the TRichEdit component is Paragraph.Alignment. This property directly controls the alignment of the text within the paragraph, making it the right choice among the options.
2.
OPEN ENDED QUESTION
3 mins • 1 pt
The Eof function returns True when the end of a file has been reached.
Evaluate responses using AI:
OFF
Answer explanation
The Eof function is designed to check if the end of a file has been reached during file operations. When it returns True, it indicates that there are no more data to read from the file.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you read lines of text from a TRichEdit component and store them in a variable?
By using the Text property and assigning it to a string variable.
By using the Paragraph.Alignment property and assigning it to a string variable.
By using the Paragraph.TabCount property and assigning it to a string variable.
By using the Lines property and assigning it to a string variable.
Answer explanation
The correct choice is to use the Lines property, which allows you to access each line of text in the TRichEdit component. Assigning it to a string variable enables you to store and manipulate the text easily.
4.
OPEN ENDED QUESTION
3 mins • 1 pt
The Reset function is used to open an existing file for reading.
Evaluate responses using AI:
OFF
Answer explanation
The Reset function is typically used to reset the file pointer to the beginning of an existing file, allowing it to be read from the start. Thus, it is indeed used for opening a file for reading.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function in Delphi is used to check if a file exists?
FileCreate
FileExists
FileDelete
FileRename
Answer explanation
The correct function to check if a file exists in Delphi is FileExists. This function returns a Boolean value indicating whether the specified file is present, making it the appropriate choice among the options provided.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function is used to close a text file in Delphi?
ReadLn
CloseFile
Exit
OpenFile
Answer explanation
In Delphi, the function used to close a text file is CloseFile. This function ensures that any changes made to the file are saved and that the file is properly closed, preventing data loss or corruption.
7.
OPEN ENDED QUESTION
3 mins • 1 pt
When reading from a text file in Delphi, it is recommended to use a CloseFile function to ensure that the file is always closed, even if an exception occurs during the reading process.
Evaluate responses using AI:
OFF
Answer explanation
Using CloseFile in Delphi ensures that the file is properly closed after reading, preventing resource leaks. This is crucial, especially when exceptions occur, as it guarantees that the file is closed regardless of errors.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?