Provide the answers in the text box below the question. Consider the code segment below assuming that the variables x, y and z are integer values. Given values for the variables x,y and z, the code segment correctly determines whether x,y and z are all equal, whether onlyx andy are equal, whether onlyx and z are equal, whether onlyy and z are equal or whether x,y and z are all different. Code Segment: 1. if (x == y && y == z) 2. System.out.println("x,y and zequal"); 3. else if (x ==y) 4. System.out.println("only x and y are equal"); 5. else if (x == z) 6. System.out.println("only x and z are equal"); 7. else if (y == z) 8. System.out.println("only y and z are equal"); 9. else 10. System.out.println("x,y and z are all different"); (A) Show that this code segment is suboptimal by giving a set of values for the variables x, yandz that causes a relational expression in the code segment to be evaluated unnecessarily. Use integer values between-5 and 5 for the set of values. Using the line numbers in the code, give a detailed explanation of which relational expressions are evaluated and the order in which they are evaluated up to and Time left 0.45:39 when the unnecessary evaluation cuplain which one is unnecessarvevaluatedad 10 AM ADO O type here to search DOLL 2-2 (A) Show that this code segment is suboptimal by giving a set of values for the variables x, y and z that causes a relational expression in the code segment to be evaluated unnecessarily. Use integer values between -5 and 5 for the set of values. Using the line numbers in the code, give a detailed explanation of which relational expressions are evaluated and the order in which they are evaluated up to and including when the unnecessary evaluation occurs. Explain which one is unnecessarily evaluated and why. [10 points) (B) Suppose E denotes the average number of relational expressions that is evaluated per outcome (output) of a code segment involving if-statement(s). Complete the chart below and then calculate E for the code segment above. (10 points] Chart Outcome Number of Relational Expressions Evaluated Ky and Z are equal only and y are equal only and are equal only y and are equal X Y and Z are all different (C) Give an optimal version of the code segment above that eliminates the potential for unnecessary evaluations of relational expressions. Do not use any additional relational operators or arithmetic operators, such as etc, in this version of the code segment. (10 points) (D) Write and complete a chart similar to the one given in this exercise then calculate for the optimal version of the code segment that you wrote in (C). [10 points) Provide the answers in the text box below the question. Consider the code segment below assuming that the variables x, y and z are integer values. Given values for the variables x,y and z, the code segment correctly determines whether x,y and z are all equal, whether onlyx andy are equal, whether onlyx and z are equal, whether onlyy and z are equal or whether x,y and z are all different. Code Segment: 1. if (x == y && y == z) 2. System.out.println("x,y and zequal"); 3. else if (x ==y) 4. System.out.println("only x and y are equal"); 5. else if (x == z) 6. System.out.println("only x and z are equal"); 7. else if (y == z) 8. System.out.println("only y and z are equal"); 9. else 10. System.out.println("x,y and z are all different"); (A) Show that this code segment is suboptimal by giving a set of values for the variables x, yandz that causes a relational expression in the code segment to be evaluated unnecessarily. Use integer values between-5 and 5 for the set of values. Using the line numbers in the code, give a detailed explanation of which relational expressions are evaluated and the order in which they are evaluated up to and Time left 0.45:39 when the unnecessary evaluation cuplain which one is unnecessarvevaluatedad 10 AM ADO O type here to search DOLL 2-2 (A) Show that this code segment is suboptimal by giving a set of values for the variables x, y and z that causes a relational expression in the code segment to be evaluated unnecessarily. Use integer values between -5 and 5 for the set of values. Using the line numbers in the code, give a detailed explanation of which relational expressions are evaluated and the order in which they are evaluated up to and including when the unnecessary evaluation occurs. Explain which one is unnecessarily evaluated and why. [10 points) (B) Suppose E denotes the average number of relational expressions that is evaluated per outcome (output) of a code segment involving if-statement(s). Complete the chart below and then calculate E for the code segment above. (10 points] Chart Outcome Number of Relational Expressions Evaluated Ky and Z are equal only and y are equal only and are equal only y and are equal X Y and Z are all different (C) Give an optimal version of the code segment above that eliminates the potential for unnecessary evaluations of relational expressions. Do not use any additional relational operators or arithmetic operators, such as etc, in this version of the code segment. (10 points) (D) Write and complete a chart similar to the one given in this exercise then calculate for the optimal version of the code segment that you wrote in (C). [10 points)