Test
Grade 11 Computer Science Exam
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (53)
1Which of the following values would be best represented with a constant?
- APlayer name
- BPlayer level
- CPlayer score
- DPlayer location
2Which of the following would be best represented with a variable?
- AName
- BBirthday
- CAge
- DHome address
3Which keywords is used to declare a constant
- Aconst
- Bvar
- Clet
4Which keyword is used to declare a variable?
- Aconst
- Bvar
- Clet
5Which of the following is not a reason for declaring most values as constants?
- AIt is a best practice
- BThe compiler can make special optimizations for immutable values
- CIt is safer; developers can rely on consistent value
- DMost values never change
6Using type interference, which of the following variables would be assigned a Double type?
- Avar state = "Rhode Island"
- Blet country = "Belgium"
- Clet population = 142000
- Dlet speedLimit = 75.0
7Will the following code snippet compile? Why?
let number: Double = 3- AYes, because the compiler will assign the value 3.0 to number
- BYes, because 3 is a Double
- CNo, because 3 is not a Double
8What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = x + y + z- A4
- B6
- C10
- D12
9What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = x + y * z- A18
- B26
- C32
- D36
10What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = x * y - z- A2
- B4
- C6
- D12
11What is the value of myNumber at the end of the following code?
let x = 2
let y = 4
let z = 6
let myNumber = (x + y) * z- A12
- B24
- C36
- D42
12let x = 14
let y = 2.5
let result = x * y- AThe code will not compile. x is a Double and y is an Int
- BThe code will not compile. x is an Int and y is a Double
- CThere is no issue. result will equal the product of x and y
13What is the operator called when it has an arithmetic symbol in front of the equal? =?
myScore += 100- AAssignment operator
- BCompound assignment operator
- CPlus equals operator
- DReset operator
14Which of the following logical operators means "equals"?
- A=
- B==
- C!=
- D>=
15Which of the following logic operators means "NOT"?
- A!=
- B!
- C||
- D<
16Which of the following logical operators means "greater than"?
- A<
- B>
- C<=
- D>=
17Which of the following logical operators means "less than or equal to"?
- A<
- B>
- C<=
- D>=
18Which of the following logic operators means "AND"?
- A!
- B||
- C&&
- D!=
19Which of the following logic operators means OR?
- A!
- B||
- C&&
- D!=
20What will print to the console when executing the following code?
var time = 6
if time < 12 {
print("Good morning")
} else if time < 20 {
print("Good afternoon")
} else {
print("Good evening")
}- A"Good morning"
- B"Good afternoon"
- C"Good evening"
- DNothing will print to the console
21var weight = 52
if weight <= 50{
print("Having a great flight")
} else {
print("There is a $25 fee for your luggage")
}- A"Have a great flight"
- B"There is a $25 fee for your luggage"
- CNothing will print to the console
22var grade: Character
let score = 78
switch score {
case 90...100:
grade = "A"
case 80...89:
grade = "B"
case 70...79:
grade = "C"
case 61...69:
grade = "D"
default:
grade = "F"
}- AA
- BB
- CC
- DD
- EF
23 What is the value of mood after executing the following code?
let cookies = [Cookie(.chocolate), Cookie(.peanutButter), Cookie(.blackAndWhite)]
let mood = cookies.count() > 2 ? ;) : ;(- Acookies.count()
- B;(
- C;)
24What do you use to switch to running code on a physical device instead of using a Simulator?
- ARun button
- BScheme menu
- CDebug Area
25After code execution has paused at a breakpoint, which button will resume execution?
- AContinue
- BStep over
- CStep into
- DStep out
26How is an XIB different from a storyboard?
- AAn XID represents a single view object, while a storyboard represents multiple views, scenes, and how to navigate between them
- BA XID represents multiple views, scenes, and how to navigate between them, while a storyboard represents a single view object
27What does the gray arrow next to a storyboard scene indicate?
- AThat the scene is the one you are currently editing
- BThat the scene is the initial view controller
- CThat the scene has an error and you are unable to build
- DThat the scene is finished
28What is an IBOutlet?
- AA reference to a piece of code that will execute when the user interacts with a control
- BA reference to a visual element in code so it can be adjusted at runtime
29What is an IBAction?
- AA reference to a piece of code that will execute when the user interacts with a control
- BA reference to a visual element in code so it can be adjusted at runtime
30What is the Document Outline used for?
- ADisplays a list of each view controller in the scene, along with a hierarchical list of the elements within each view controller
- BAllows you to edit the properties related to an object's identity, such as what class it belongs to
- CProvides a list of adjustable visual properties for the selected item
- DAllows you to adjust the size and position of the selected element within the scene
- ELists all the functions and variable names related to an object
31What is the Identity inspector used for?
- ADisplays a list of each view controller in the scene, along with a hierarchical list of the elements within the view controller
- BAllows you to edit the properties related to an object's identity, such as what class it belongs to
- CProvides a list of adjustable visual properties for the selected item
- DAllows you to adjust the size and position of the selected item within the scene
- ELIsts all the functions and variable names related to the object
32What is the Attributes inspector used for?
- ADisplays a list of each view controller in the scene, along with a hierarchical list of all the elements within each view controller
- BAllows you to edit the properties related to an object's identity, such as what class it belongs to
- CProvides a list of adjustable visual properties for the selected item
- DAllows you to adjust the size and position of the selected element within the scene
- EList all the functions and variable names related to the object
33What is the Size inspector used for?
- ADisplays a list of each view controller in the scene, along with a hierarchical list of elements within each view controller
- BAllows you to edit the properties related to an object's identity, such as what class it belongs to
- CProvides a list of adjustable visual properties for the selected item
- DAllows you to adjust the size and position of the selected element within the scene
- ELists all the functions and variable names related to the object
34What is the Connections inspector used for?
- ADisplays a list of each view controller in the scene, along with a hierarchical list of the elements within each view controller
- BAllows you to edit the properties related to an object's identity, such as what class it belongs to
- CProvides a list of adjustable visual properties for the selected item
- DAllows you to adjust the size and position of the selected element within the scene
- ELists all the functions and variables names related to the object
35When you declare a String, how do you set the initial value?
- AWith Unicode
- BWith a string literal
- CWith the operator +=
- DWith an index
36To compare two strings, how would you check for equality?
- AWith the operator ==
- BWith a string literal
- CWith an index
- DWith the lowercased() method
37Given the following code, what is the resulting type of ox
let o: Character = "O"
let x: Character = "x"
let ox = String(o) + String (x)- A[Character]
- BCharacter
- CString
- D"Ox"
38Given the following code what is the resulting value of mathExpression?
let b = 5
let m = "3"
let x = 5
let mathExpression = "Solve for x. 20 = \(m) + \(b)"- A"Solve for x. 20 = 3x + 5"
- B"Solve for x. 20 = 5x + 3"
- C"Solve for 5. 20 = 55 + 5
- D5
39Why does the following expression return false?
"Jonathan" == "jonathan"- AIt doesn't. The expression returns true
- BAn uppercase character and a lowercase character aren't the same thing
- CBecause == is the wrong operator for string equality
40Why does the following function not compile?
func increment(_ value: Int by amount: Int) -> Int {
return value + amount
}- AThe function doesn't have a print function
- BThe first parameter must have an argument label
- Cincrement(_: by :_) is already a function in swift
- DThe function parameters aren't separated by commas
41A function can be called using the code below. How was the function declared?
let value = multiply(5, by: 4)- Afunc multiply (_ first: Int, by: Int)
- Bfunc multiply (first: Int, by: Int) -> Int
- Cfunc multiply (_ first: Int, by: Int) -> Int
- Dfunc multiply (first: Int, by: Double) -> Int
42Which function returns two integers?
- Afunc getRequestedError() -> (String,Int)
- Bfunc getRequestedError() -> (Int,Int)
- Cfunc getRequestedError() -> (Int,Int,Int)
- Dfunc getRequestedError()
43Given the following dictionary, what is the result of executing
numberOfLegs["snake"] = 0?
var numberOfLegs = ["spider": 8, "human": 2, "dog": 4, "cat": 4]- ANothing, numberOfLegs cannot be modified
- B"snake " is added as a key, with value of 0
- C"snake" is updated to have a value of 0 instead of 4
- DAn error is thrown because two keys in the dictionary have the same value
44Which piece of code will insert an item into the set of integers, bankAccounts?
- AbankAccounts.insert(12345, at: 0)
- BbankAccounts.insert(12345)
- CbankAccounts.append(12345)
- DbankAccounts[0] = 12345
45Which of the following are used to loop over a section of code?
- Afor, if, while
- Bwhile, Range, if
- Cfor, while, do
- Dfor, while
46Which of the following loops through the range 0-9 and ignores the range value?
- Afor value in 0...10
- Bfor value in 0..<10
- Cfor _ in 0...10
- Dfor _ in 0..<10
47Which segue adapts its presentation style from modal to push if a navigation controller is present?
- AUnwind
- BShow
- CPopover
- DReplace
48A navigation bar includes a _________ property that contains a title and a set of buttons
- ASegue
- BBar Button Item
- CNavigation Item
- DController
49You can perform a segue programmatically as long as the segue has been given a/an:
- AOutlet
- BSource
- CDestination
- DIdentifier
50What property would you modify if you wanted to add a badge to a tab?
- AbadgeIcon
- BbadgeString
- Cbadge
- DbadgeValue
51What value would you assign to a badge to hide it
- Anil
- B0
- C" "
- D""
52When should you use a tab bar controller?
- AWhen your app has distinct modes
- BWhen you want to present many different tools to the user
- CWhen you want to navigate from one view controller to another, within the same context
53Why might you need to perform a segue programmatically?
- AWhen you are unsure if you should present the destination view controller modally or with a push
- BWhen you need logic that determines the segue
- CWhen you are unsure which data to pass to the destination view controller
Información
- Descripción
- Test sobre Grade 11 Computer Science Exam, creado por Cameron Dunn el 17/06/2019.
- Autor
- Cameron Dunn
- Idioma
- English
- Visitas
- 0
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test
Más sobre Variables, Constants and Data Types