Answered step by step
Verified Expert Solution
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
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 ArrayListsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started