Unit 1 Jan 2017 Question 4 preparation

Quiz
•
Computers
•
11th Grade
•
Medium

Sarah Williams
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 3 pts
What does if(userid.text!= "") do?
Check to see if "" is the text box
Check to see if the text box is empty
Check to see if the text box exists
Check to see if there is text in the text box
Answer explanation
The condition if(userid.text != "") checks if the text box is not empty. If it contains any text, it evaluates to true, confirming that there is text in the text box.
2.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does if(userid.text!= "" && ridename.text!="") do?
Check to see if "" is in the userid and ridename text box
Check to see if the userid and ridename text boxes are empty
Check to see if the userid and ridename text boxes exists
Check to see if there is text in the userid and ridename text boxes
Answer explanation
The condition checks if both userid and ridename text boxes are not empty. If they contain text, the condition evaluates to true, indicating that valid input is present.
3.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does File.ReadAllLines(@"./log.txt") do?
Reads the first line of text from the log.txt file
Reads all the lines from the log.txt file
Writes @ to the log.txt file
Clears the log.txt file
Answer explanation
File.ReadAllLines("./log.txt") reads all lines from the specified log.txt file and returns them as an array of strings. This makes the correct answer 'Reads all the lines from the log.txt file'.
4.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does File.ReadAllLines(@"./log.txt").Length return?
The number of characters in the text file
The size of the text file
The number of lines in the text file
How many @ characters appear in the text file
Answer explanation
File.ReadAllLines reads all lines from a file and returns them as an array. The Length property of this array indicates the number of lines in the text file, making 'The number of lines in the text file' the correct answer.
5.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does adding .ToString do to File.ReadAllLines(@"./log.txt").Length so it becomes File.ReadAllLines(@"./log.txt").Length.ToString()
Changes the integer length to a string
Changes the string length to an integer
Changes the array to a string
Changes the file to a string
Answer explanation
Adding .ToString converts the integer result of File.ReadAllLines(@"./log.txt").Length into a string representation. This is important for scenarios where a string format is required, making the correct choice: 'Changes the integer length to a string'.
6.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does the instruction File.AppendAllText( filename, array) do?
Overwrites the text in the text file with the text in the array
Deletes the textfile
Adds text from the array to the existing text in the text file
Creates a new array
Answer explanation
File.AppendAllText appends the text from the array to the existing content of the specified text file, rather than overwriting it. This means any previous text remains intact while new text is added.
7.
MULTIPLE CHOICE QUESTION
45 sec • 3 pts
What does the Parse command do, eg int.Parse()?
Changes the given text to a different data type
Adds the text to an array
Adds the text to a file
Creates a new text file
Answer explanation
The Parse command, such as int.Parse(), converts a string representation of a number into an integer data type. This is why the correct answer is 'Changes the given text to a different data type'.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Using the Common Features of Microsoft Office Word

Quiz
•
10th - 11th Grade
15 questions
File Formats

Quiz
•
9th - 12th Grade
10 questions
Adobe InDesign

Quiz
•
11th Grade
10 questions
MOAC Excel 2016 Lesson 03

Quiz
•
8th - 12th Grade
10 questions
Python Basic files

Quiz
•
10th - 12th Grade
15 questions
J277 Operating Systems

Quiz
•
10th - 12th Grade
10 questions
1.2.2 1.2.3 1.2.4 Cybersecurity

Quiz
•
9th - 12th Grade
15 questions
Creative iMedia Revision

Quiz
•
10th - 11th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade