SECTION 1 MCQ’S
Choice 1
Choice 3
Choice 1,2
Choice 1,3,5
Choice 1,2,4
Choice 1,3
Choice 1
Choice 2
Choice 2,3
SECTION 2 RATING
Write a program in Java to compute the sum of two numbers that sum up to a given number K.
Response 1 - 5, 5, 5, 5, 1, 1
Response 2 - 5, 5, 2, 5, 1, 1
Explain this code. Go step by step, explaining each line in detail:
const re = /A[a-zA-Z]+g/;
const str = "I like to fun";
const myArray = str.match(re);
console.log(myArray);
Response 1 - 2 , 5 , 5, 2, 1, 1
Response 2- 5, 5, 5, 5 1, 1
Write a JS/React component for showing a button that opens a popup and says 'Hello, how are you?
Response 1 - 2,3,4,4,1,1
Response 2 – 5,3,5,5,1,1
Explain to me why I get this error message:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at ArrayClass.main(test2.java:4)
When I tried to run the following code:
public class ArrayClass {
public static void main(String[] args) {
int[] numbers = {1, 2, 3, 4, 5};
System.out.println(numbers[5]);
}
Response 1 - 2,4,2,2,1,1
Response 2 – 5,5,5,5,1,1
I'm trying to initialize a list of points in python where the y coordinate is double the x coordinate and the x coordinate is increasing from 0 to 5. Please tell me what I'm doing wrong
o = {"x": 0, "y": 0}
l = []
for i in xrange(0, 5):
m = o
m["x"] = i
m["y"] = i*2
l.append(m)
print(l)
Do'stlaringiz bilan baham: |