Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want answer this quickly please b) Suppose: int x=5; int y=2; double z=3.5; Write the output of the following code fragment. code fragment output

I want answer this quickly please image text in transcribed
image text in transcribed
b) Suppose: int x=5; int y=2; double z=3.5; Write the output of the following code fragment. code fragment output System.out.println(x%y); 1 System.out.println(x++); 5 System.out.println(y++ * x); 12 System.out.println(Math.ceil(z)); 4.0 18 x*=y; System.out.println(x); System.out.println(y+(int)z); 6 Question 4: 110 Marks Suppose: String str="Welcome, this is CSE 102"; String str2=str; String str3=new String("Welcome, this is CSE 102"): String str4="WELCOME, THIS IS CSE 102"; Write the output for each of the given string function. this is CSE System.out.println(str.substring(8,20)); 2 System.out.println(str.charAt(23)); Welcome, this Is CSE 102 System.out.println(str.replace('i', T)); false System.out.println(str.startsWith("102")); 6 System.out.println(str.lastIndexOf("e")); false System.out.println(str=str3); System.out.println(str.equals(str3)); true false Welcome, this is CSE 102, CSE System.out.println(str.equals(str4)); str2=str.concat(", CSE"); System.out.println(str2); System.out.println(str2.compare To(str)); 5

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_2

Step: 3

blur-text-image_3

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions