Question: Question 4 (10 points) What does the following code output? Java/C# Code Java C# int x=7; int y=10; int x=7; int y=10; if((x>5) && (y>12))

 Question 4 (10 points) What does the following code output? Java/C#

Code Java C# int x=7; int y=10; int x=7; int y=10; if((x>5)

&& (y>12)) { Console.WriteLine("A"); else if((x10)) { Console.WriteLine("B"); if((x>5) && (y>12)) {

Question 4 (10 points) What does the following code output? Java/C# Code Java C# int x=7; int y=10; int x=7; int y=10; if((x>5) && (y>12)) { Console.WriteLine("A"); else if((x10)) { Console.WriteLine("B"); if((x>5) && (y>12)) { System.out.println("A"); } else if((x10)) { System.out.println("B"); } else if((x2)) { System.out.println("C"); } else { System.out.println("D"); 13 else if((x2)) { Console.WriteLine("C"); else { Console.WriteLine("D"); A B D Question 5 (10 points) What does the following code output? What does the following code output? Java C# char letters[]=new char[5]; char[] letters=new char[5]; letters[0]='a'; letters[1]='b'; letters[0]='a'; letters[2]='c'; letters[1]='b'; letters[3]="d"; letters[2]='c'; letters[4]='e'; letters[3]='d'; letters[4]='e'; String x=""; for(int i=4;i>=2; i--) { String x=""; x+=letters[i]; for(int i=4;i>=2;i--) { } x+=letters[i]; System.out.println(x); Console.WriteLine(x); abcd edcb ed edc Question 6 (10 points) Which of the following methods are invalid? Which of the following methods are invalid? Java C# public static void do_stuff_1() { return; public static void do_stuff_1() { } return; public static int do_stuff_20) { } return 2; public static int do_stuff_20 { } return 2; public static char do_stuff_30) { } return 'c'; public static char do_stuff_30) { } return 'c'; public static boolean do_stuff_40) { } return false; public static bool do_stuff_40 { } return false; } do_stuff_10) do_stuff_20 do_stuff_30) do_stuff_40 They are all valid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!