CIS 1968 First Mid-Term Exam You may use one sheet of paper with notes on both sides. You may use a non-programmable calculator. You may not use a cell phone, tablet, or laptop. 75 points total 1) Consider the following lines of Java: int i = 10; int j = 20; int k = 30; What would be the value of each of the following expressions:(1 points each) (i + j) * k i + (j * k) i / j k / j i % j k % j k - j * (k / j) k - j * k / j 10.0 + i / k i + 10.0 / k 2)Consider the following: p = true; q = false; r = 3 > 7 What would be the value of each of the following expressions (1 point each) p || (q && r) (p || q) && (p || r) (p && !q) || (q && !p) (0 <= 17) && (17 <= 100) !( (0 > 17) || (17 > 100) ) 2) Show exactly what the following code fragment would print. Show your work(10 points) for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { System.out.println("i = " + i + " j = " + j); } } 3)You want to write the following Java code: if(x >= 0.0 && x <= 100.0) { System.out.printn("It is ok"); } But you discover that someone has stolen the && operator. Write a functionally equivalent piece of Java without using && (10 points) 4)Consider the following partially written class public class Domino { private int leftNumber; private int rightNumber; public Domino(int spots1, int spots2) { // constructor. spots1 and spots2 should be between 0 and 6 inclusive // if spots1 is not equal to spots2, put the smaller value into leftNumber, // the larger number into rightNumber. If either is of range, print an error // message and crash the program } public String toString() { return left + "|" + right; } public int getLeft() //getter function for rightNumber { } public int getRight() //getter function for leftNumber { } public Boolean endsMatch() //true if leftNumber == rightNumber { } public Boolean equals(Domino rhs) //true if both dominos are the same, false otherwise { } a) finish the constructor (5 points) b) finish both getter functions (5 points) c) finish endsMatch() (5 points) d) finish equals() (5 points) 5) Using the class from problem 4) consider the following questions: import java.util.Scanner; public class Something { public static void main(String args[]) { Scanner kb = new Scanner(System.in); Domino stack[] = new Domino[28]; int next = 0; for (int left = 0; left < 7; left++) { for (int right = left; right < 7; right++) { stack[next] = new Domino(left, right); mext++; } } System.out.println(stack[0] + " " + stack[27])l System.out.print("Enter a left number:"); int leftTarget = kb.nextInt(); System.oujt.prin("Enter a right number:"); int rightTarget = kb.nextInt(); Domino target = new Domino(leftTarget, rightTarget); int where = Something.ls(stack, 28, target); if (where >= 0) System.out.println("Found it at subscript " + i); else Systgem.out.println("Didn't find it") } public static int ls(Domino d[], int size, int target) { int retval = -1; for (i = 0; i < 28; i++) { if (stack[i].equals(target) ) { retval = i; } } return retval; } } a) describe in words what will be in the array named stack after the first pair of for loops has finished.(5 points) b) What would be printed by the println just after that first pair of for loops (5 points) c) What algorithm am I implementing in the function named ls? (5 points) d) What does the word static mean in the line that reads public static int ls(Domino d[], int size, int target) (5 points)