Question: Learn to compare strings. Assignment: In library management software, one of the main features is a system that helps employees re - order bookshelves. You

Learn to compare strings.
Assignment: In library management software, one of the main features is a system that helps employees re-order bookshelves. You are tasked with writing the code that informs them whether a title comes before or after another or if the titles are the same.
Assuming the String variables previousTitle and title have already been declared and assigned, write some code that prints out whether title comes lexicographically before, after or is the same as previousTitle ignoring case.
Sample Runs
"The Viper and the Mouse" comes after "A Dissertation over Nature"
"Apricots: All the Ways to Cook Them" comes before "Lutward, and the Room of Empty Boxes"
"Thunderbolts and Pad Thais" is equal to "Thunderbolts and Pad Thais"

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 Programming Questions!