Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program which prompts the user for three Strings , then sorts and displays them in lexicographic order on your screen: If the user

Write a program which prompts the user for three Strings, then sorts and displays them in lexicographic order on your screen:

  • If the user enters "quit" at any prompt, then your program should end
  • Strip off any leading blanks in the Strings before sorting

A sample dialog is below (user input is in italics and underlined):

 Please enter three Strings below: String 1: Now is the time for all good men String 2: We the people String 3: Ask not what your country can do for you Those Strings in lexicographic order are: 1. Ask not what your country can do for you 2. Now is the time for all good men 3. We the people 

Run your program on the following test data sets. User input is in italics and underlined:

Data set 1 (note the spaces in front of the first entry): String 1: Baker String 2: Charlie String 3: Able

Data set 2: String 1: 9 String 2: 1000 String 3: One thousand

Data set 3: String 1: miracosta String 2: MIRACOSTA String 3: MiraCosta

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

More Books

Students also viewed these Databases questions