Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete this in java only and by reading from a text file PROBLEM: Given 2 strings with all capital letters, eliminate characters using each

Please complete this in java only and by reading from a text file image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
PROBLEM: Given 2 strings with all capital letters, eliminate characters using each of the rules below once until only different characters align. The rules are performed in the following order: Delete the second occurance of any double consonant. There will not be more than 2 of the same consonant together. Delete all vowels (A, E, I, O, U) unless the vowel is the first character in the string. Align the resulting strings from left to right. Then delete all like characters at like positions. Align the remaining characters from right to left. Then delete like characters at like positions starting from the end of the string. Example: MISSISSIPPI MISSOURI After removing the double consonants: MISISIPI MISOURI After removing the vowels: MSSP MSR After removing letters from L to R in same location: SP After removing letters from R to L in the same location (no changes): Output: R INPUT: There will be 5 inputs. Each input will contain 2 strings separated by a single space and each fewer than 80 characters. OUTPUT: For each input, print the shorter of the two resulting strings or the first in alphabetical order if they have the same length. We guarantee that neither is an empty string, SAMPLE INPUT SAMPLE OUTPUT: http://www.datafiles.acsl.org/2020/contest2/jr-sample-input.txt MISSISSIPPI MISSOURI CATHERINE KATHERYNE CONSTITUTIONAL CONVENTIONAL COMPARTMENTALIZATION SEMIAUTOBIOGRAPHICAL PHYSICIAN PHARMACY 1. R 2.C 3. VN 4. SBGRPHCL 5. RMY TEST DATA TEST INPUT: FEEFI FOFUM FIDDLEDEEDEE MYLOLLIPOPS MYLARBALLOONS CONNECTICUTCT CONSTITUTIONSTATE MASSACHUSETTSBAYCOLONY MINUTEMANNATIONALHISTORICAL PARK AMERICANCOMPUTERSCIENCELEAGUE NATIONALACADEMICGAMESLEAGUE TEST OUTPUT: 1. DLDD 2. LPP 3. CCC 4. SCSBYCLNY 5. NTNLCDGM FEEFIFOFUM FIDDLEDEEDEE MYLOLLIPOPS MYLARBALLOONS CONNECTICUTCT CONSTITUTIONSTATE MASSACHUSETTSBAYCOLONY MINUTEMANNATIONALHISTORICALPARK AMERICANCOMPUTERSCIENCELEAGUE NATIONALACADEMICGAMESLEAGUE MISSISSIPPI MISSOURI CATHERINE KATHERYNE CONSTITUTIONAL CONVENTIONAL COMPARTMENTALIZATION SEMIAUTOBIOGRAPHICAL PHYSICIAN PHARMACY

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Carry out an interview and review its success.

Answered: 1 week ago