Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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))

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

Is the person willing to deal with the consequences?

Answered: 1 week ago