Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 1 1 . 2 : Print two strings in alphabetical order. Print the two strings, firstString and secondString , in alphabetical order. Assume

2.11.2: Print two strings in alphabetical order.
Print the two strings, firstString and secondString, in alphabetical order. Assume the strings are lowercase. End with newline.
Sample output:
capes rabbits
Learn how our autograder works
546242.2877792.qx3zqy7
secondString = scnr. next();
firstString="rabbits";
secondString="capes";
if (firstString.compareTo(secondString)0)
{
System.out.println(firstString +""+ secondString);
}
else
{
System.out.println(secondString +""+ firstString);
}
23
243
25
Not all tests passed
Testing input rabbits capes
Your output
Testing input capes rabbits
Your output
x Testing input clearly clear
Output differs. See highlights below.
Your output
Expected output
x Testing input wand wand
Output differs. See highlights below.
Your output
Expected output
image text in transcribed

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt AI 5 1 0

Answered: 1 week ago