
Backend Quiz 2 - variable declaration
Authored by Jamyang Choden
Computers
University
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Is the following a valid way of initializing and assigning a value to a variable?
var bookTitle string = "Harry Potter"
Yes
No
Only sometimes
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Is the following a valid way of initializing an assigning a value to a variable?
fruitCount := 5
Yes
No
Only sometimes
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
After running the following code, Go will assume that the variable
quizQuestionCount
is of what type?
quizQuestionCount := 10
Float
Integer
String
Map
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Will the following code compile? Why or why not?
paperColor := "Green"
paperColor := "Blue"
Yes, because we are creating and assigning a value to the variable 'paperColor' twice.
No, because a variable can only be initialized one time. In this case, the ':=' operator is being used to initialize 'paperColor' two times
No, because ':=' is not a valid operator
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Are the two lines following ways of initializing the variable 'pi' equivalent?
pi := 3.14
var pi float64 = 3.14
Yes
No
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
This might require a bit of experimentation on your end :). Remember that you can use the Go Playground at https://play.golang.org/ to quickly run a snippet of code.
Is the following code valid?
package main
import "fmt"
deckSize := 20
func main() {
fmt.Println(deckSize)
}
Yes
No
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
We might be able to initialize a variable and then later assign a variable to it. Is the following code valid?
package main
import "fmt"
func main() {
var deckSize int
deckSize = 52
fmt.Println(deckSize)
}
Yes
No
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 Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
FOP - CHAPTER 4
Quiz
•
University
10 questions
McCall factor model
Quiz
•
University
13 questions
BACS3323 Chapter 4 -Flocking Algorithm
Quiz
•
University
10 questions
Module 09 - Day 3
Quiz
•
University
12 questions
Python Quiz 1.4
Quiz
•
University
14 questions
Sorting Algorithms
Quiz
•
University
11 questions
Latex
Quiz
•
University
10 questions
CodeMonkey for B.Ed IT
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade