C++ Royal Names An ordinal number is a word representing rank or sequential order. The naming convention
Fantastic news! We've Found the answer you've been seeking!
Question:
C++
Transcribed Image Text:
Royal Names An ordinal number is a word representing rank or sequential order. The naming convention for royal names is to follow a first name with an ordinal number, which is essentially a Roman numeral used to indicate the birth order of two people having the same name. The Roman numerals from 1 to 50 are defined as follows: The respective numerals corresponding to numbers 1 through 10 are 1, II, III, IV, V, VI, VII, VIII, IX, and X. The respective numerals corresponding to the numbers 20, 30, 40, and 50 are XX, XXX, XL, and L. • The numeral for any other two-digit number < 50 is constructed by concatenating the numeral(s) for its multiples of ten with the numeral(s) for its values < 10. For example, 47 is 40 + 7 = "XL" + "VII" = "XLVII". . . Complete the getSorted List function in your editor. It has 1 parameter: an array of royal name strings, names. Each royal name string consists of a first name, followed by a single space, followed by a Roman numeral. Your function must sort the names lexicographically (alphabetically) by first name; if two or more first names are the same, it must sort those duplicate first names by ascending ordinal number. It must then return the sorted array of royal name strings. Input Format The locked stub code in your editor reads the following input from stdin Ask me anything Royal Names An ordinal number is a word representing rank or sequential order. The naming convention for royal names is to follow a first name with an ordinal number, which is essentially a Roman numeral used to indicate the birth order of two people having the same name. The Roman numerals from 1 to 50 are defined as follows: The respective numerals corresponding to numbers 1 through 10 are 1, II, III, IV, V, VI, VII, VIII, IX, and X. The respective numerals corresponding to the numbers 20, 30, 40, and 50 are XX, XXX, XL, and L. • The numeral for any other two-digit number < 50 is constructed by concatenating the numeral(s) for its multiples of ten with the numeral(s) for its values < 10. For example, 47 is 40 + 7 = "XL" + "VII" = "XLVII". . . Complete the getSorted List function in your editor. It has 1 parameter: an array of royal name strings, names. Each royal name string consists of a first name, followed by a single space, followed by a Roman numeral. Your function must sort the names lexicographically (alphabetically) by first name; if two or more first names are the same, it must sort those duplicate first names by ascending ordinal number. It must then return the sorted array of royal name strings. Input Format The locked stub code in your editor reads the following input from stdin Ask me anything
Expert Answer:
Related Book For
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi
Posted Date:
Students also viewed these programming questions
-
C plc wants to reward its directors for their service to the company and has designed a bonus package with two different elements as follows. The directors are informed of the scheme and granted any...
-
C and D agree to form a partnership. C is to contribute $50,000 in assets and to devote one-half time to the partnership. D is to contribute $20,000 and to devote full time to the partnership. How...
-
C Co. reported a retained earnings balance of $370,000 on December 31, 2017. In September 2018, C determined that insurance premiums of $54,000 for the three-year period beginning January 1, 2017,...
-
The future value S of principal P invested for n years with an interest rate r% compounded annually may be calculated using the formula Rearrange this formula to express P in terms of S, r and n. S =...
-
What does the theory of purchasing power parity predict in the long run regarding the inflation rate of a country that fixes its exchange rate to the U.S. dollar?
-
Scenic Tours, Inc., is a provider of bus tours throughout the New England area. The corporation is considering the replacement of 10 of its older buses. The existing buses were purchased 4 years ago...
-
Can you create a graphic of the Fairmont payroll systems company expenses that highlight general accounting clerk, Mary Perez, has company expenses for FICA (social security), Medicare and 401K,...
-
At December 31, 2010, Fell Corporation had a deferred tax liability of $680,000, resulting from future taxable amounts of $2,000,000 and an enacted tax rate of 34%. In May 2011, a new income tax act...
-
On January 1, 2023, Blossom Ltd. acquires a building at a cost of $200,000. The building is expected to have a 20-year life and no residual value. The asset is accounted for under the revaluation...
-
The manager of HerkyHornet press hires you as a consultant. She plans to order a newly-published book that is on the 2022 best-seller list. However, she is not sure about the demand for this book....
-
Maendeleo Ltd. is a manufacturing company operating through a number of branches in Kenya. The following information relates to Maendeleo Ltd.s operations for the year ending 31 December 2020. Sh 000...
-
What happens to capital losses in excess of the allowed current year deduction?
-
Discuss the tax treatment of liquidating distributions of installment obligations.
-
Which of the following taxes are deductible for federal income tax purposes as an itemized deduction? a. Federal income tax b. Federal gasoline tax c. State income tax d. Excise tax imposed on...
-
Discuss the consequences to a partnership that elects a fiscal year under Code Sec. 444 to avoid a required tax year of December 31.
-
Give five examples of the types of adjustments that states make to a taxpayer's federal tax base.
-
What is the annual premium for a 30-year-old female to purchase $25,000 in a 20-year endowment, if the cost per $1,000 unit of insurance for a 25-year-old male is $45.31? ______ 12. What is the cash...
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
Explain the structure of a module of code that defines a trigger.
-
Create a join index on the CustomerlD fields of the Customer_T and Order_T tables in Figure 4-4. Pine Valley Furniture Company data set provided with the text. E Customer T 23 Customerstati -...
-
Develop an EER model for the following situation using the traditional EER notation, the Visio notation, or the subtypes inside supertypes notation, as specified by your instructor: Wally Los Gatos...
-
Internet Inhand Ltd began producing netbooks on 1 July 2019. A unit of production passes through two processes manufacturing and finishing. Production data for the month of July are presented below....
-
Tsoulos, Tsoulakis and Associates is a small firm of architectural consultants. At 1 July 2018, three architects other than the principals, Tony Tsoulos and Maria Tsoulakis, are employed. The...
-
Melaleuca Manufacturing Ltd produces timber felling machines for the forestry industry around the world. Its two machines are the Tree Toppler, which cuts down trees and clears undergrowth, and the...
Study smarter with the SolutionInn App