Question: Question 18 (2 points) Consider the following methods, which appear in the same class. public int first(int a, int b) return a + b; }

Question 18 (2 points) Consider the following methods, which appear in the same class. public int first(int a, int b) return a + b; } public int second(int a, int b) return b - a; } Which of the following statements, if located in a method in the same class, will initialize the variable score to 11? O int x = second (4, 5) + first(1, 3); O int x = first (4, 5) + second(3, 1); O int x = first (3, 1) + second(4, 5); O int x = first (4, 5) + second (1, 3); O int score second (3, 1) + first (4, 5); Question 6 (2 points) Which of the following statements assigns a random integer between 1 and 6, inclusive, to diceRoll? int diceroll = (int) (Math.random() 6); O int diceRoll - (int) (Math.random() + 1) * 6; Oint diceRoll - (int) (Math.random() * 6) + 1; O int diceRoll - (int) (Math.random()) R 6 + 1; O int diceRoll = (int) (Math.random()) 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
