Assume that variable s has been declared as a string variable and initialized to a non-empty string literal. Which of the following statement will cause a syntax error? a := s //statement As = ‘B’ //statement B
Which is a valid function in Go that returns the results of…
Which is a valid function in Go that returns the results of swapping two integers?
What is the output of the following Go code block? letter…
What is the output of the following Go code block? letters := string{“Aa”, “Bb”, “Cc”, “Dd”, “Ee”} s1 := letters fmt.Println(s1)
Complete the following Go code block so that it declares gra…
Complete the following Go code block so that it declares grades as a map that maps student names to their grades and print out all student names and their grades (DON’T type unnecessary spaces in your answers): grades := {“Alex”: 93.2, “Bob”: 64.1, “Chris”: 70.5} for := grades { fmt.Printf(“%s has a grade of %0.1f%%\n”, name, grade) } Expected output: Alex has a grade of 93.2% Bob has a grade of 64.1% Chris has a grade of 70.5%
Which of the following statement declares two string variabl…
Which of the following statement declares two string variables named x and y and initializes them to string literals “Hello” and “World” respectively?
Which of the following is an exported name in Go?
Which of the following is an exported name in Go?
Which code block in Go is equivalent to the following C/C++…
Which code block in Go is equivalent to the following C/C++ or Java code block?: int n = 1, factorial =1;while (n < 10){ factorial *= n; n++;}n = 0; Assume every code block is placed in the main function without any other statement.
Which of the following is a valid function definition in Go…
Which of the following is a valid function definition in Go that takes two integer parameters and returns a floating-point number?
For each step in the hardware interrupt process, select the…
For each step in the hardware interrupt process, select the correct sequence from the options below. Step 1. Step 2. Step 3. Step 4.
Mark true or false regarding Critical Regions: 1. Critical R…
Mark true or false regarding Critical Regions: 1. Critical Regions are regions of code that we must protect (e.g. from interruptions.) 2. Issues related to race conditions can be solved by identifying critical regions. 3. We must have some atomic operations (indivisible) or at least equivalency to define/implement critical regions. 4. Locking and Unlocking are operations that help define critical regions.