Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

As in java program, please! Must use requirements: Declares at least 3 String variables Prompts user and inputs 3 String variables At least 3 if

image text in transcribed

As in java program, please!

Must use requirements: Declares at least 3 String variables Prompts user and inputs 3 String variables At least 3 if or else-if statements

Write a program that prompts the user to enter three strings. Compare the String objects lexicographically (alphabetically) and print the strings out in alphabetical order. For example, if the three input strings were "abcd", "wyz", and "pqrs", the program would print abcd pars WXyz Be sure to test your code by giving it input data that tests every path through your code. Make a list of values for str1, str2 and str3 that would thoroughly test the code Sample Output, with user input in red Sample Run 1 Enter string 1: aaaa Enter string 2: cccc Enter string 3: bbbb Cccc Sample Run 2 Enter string 1: bob Enter string 2: chris Enter string 3: andy andy bob chris Sample Run 3 Enter string 1: aaa Enter string 2: a Enter string 3: aa Note. Do not use any Java language or library features that we have not already covered in class. For example, do not use arrays or ArrayLists

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions