Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given string strInput1 on one line and string strInput2 on a second line, assign longerString with the longer string. If the strings are the same

Given string strInput1 on one line and string strInput2 on a second line, assign longerString with the longer string. If the strings are the same length, assign longerString with "Same length". Ex: If the input is: ice price then the output is: priceimage text in transcribed

Given string strInput1 on one line and string strinput2 on a second line, assign longerString with the longer string. If the strings are the same length, assign longerString with "Same length". Ex: If the input is: ice price then the output is: price \begin{tabular}{l|l} 1 & import java.util. Scanner; \\ 2 & \\ 3 & public class stringCompare \{ \\ 4 & public static void main(String[] args) \{ \\ 5 & Scanner scnr = new Scanner(System.in); \\ 6 & String strInput1; \\ 7 & String strInput2; \\ 8 & String longerstring; \\ 9 & \\ 10 & strInput1 = scnr.nextLine(); \\ 11 & strInput2 = scnr.nextLine(); \\ 12 & \\ 13 & /* Your code goes here / \\ 14 & \\ 15 & System.out.println(longerstring); \\ 16 & \} \\ 17 & \end{tabular}

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

=+3. Describe three approaches to quitting smoking.

Answered: 1 week ago

Question

O sin (2 Bgcos 4 V21 A. 25 4 v6 . 25 24 C. 25 4 D. 25 B.

Answered: 1 week ago

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago