Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Classy Aristocrats In his memoir So, Anyway, comedian John Cleese writes of the class difference between his father (who was middle-middle-middle-lower-middle class and

image text in transcribed

image text in transcribed

in java

Classy Aristocrats In his memoir So, Anyway, comedian John Cleese writes of the class difference between his father (who was middle-middle-middle-lower-middle class and his mother (who was upper-upper lower-middle class). These fine distinctions between classes tend to confuse American readers, so you are to write a program to sort a group of people by their classes to show the true distinctions For this problem, there are three main classes: upper, middle, and lower. Obviously, the highest is upper and the lowest is lower. But there can be distinctions within a class, so upper-upper is a higher class than middle-upper, which is classes (upper-upper, middle-upper, and lower-upper) are higher than any of the middle classes Within a class like middle-upper, there can be further distinctions as well, leading to classes like lower-middle-upper-middle-upper. When comparing classes, once you've reached the lowest level of detail, you should assume that all further classes are the same as the middle level of the previous level of detail. So upper class and middle-upper class are equivalent, as are middl middle-lower-middle and lower-middle higher than lower-upper. However, all of the upper The Input he first line of input will indicate the number of test cases. For each test case that follows, the first line of input contains n, the number of names to follow. Each of the following n lines contains the name of a person as a sequence of 1 or more lower case letters, then a colon, then a single space, and then the class of the person. The class of the person will include one or more modifiers, separated by a single space, followed by a single space and then th entire line will be no longer than 256 characters e word class. The The Output r each test case, the output will consist of a list of names from highest to lowest class, one name per line. If tw Print one blank line after each test case o people have the same class, they should be listed in alphabetical order by name

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

identify the main ways in which you learn

Answered: 1 week ago