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 =...
-
1. What are the major ethical issues involved in this case? Is it ethical for an employer to benefit from the death of an employee if they took out and paid for the policy? 2. How does the idea that...
-
Compare the errors in the Midpoint and Trapezoid Rules with n = 4, 8, 16, and 32 subintervals when they are applied to the following integrals (with their exact values given). /2 sin x dx 5 32
-
Tim Walters, an attorney, had a law corporation, Tim Walters, Attorney, Inc., that began the year with total assets of \($110,000,\) total liabilities of \($80,000,\) and stockholders equity of...
-
Dublin Chips is a manufacturer of prototype chips based in Dublin, Ireland. Next year, in 2018, Dublin Chips expects to deliver 615 prototype chips at an average price of $95,000. Dublin Chips'...
-
Marketing is presenting metrics to an organization's leadership team. How is it appropriate to approach marketing to get metrics or information that can help an organization make an informed decision?
-
As she headed toward her boss's office, Emily Hamilton, chief operating officer for the Aerocomp Corporation-a computer services firm that specialized in airborne support-wished she could remember...
-
Synaptic terminals Collateral branches Telodendria Axolemma Neurilemma Node of Ranvier Postsynaptic cell Nuoleus Nucleolus
-
Diane Lane earns a salary of $10,750 per month during the year. FICA taxes are 7.65% on the first $127,200 of gross earnings and 1.45% in excess of $127,200. Federal unemployment insurance taxes are...
-
A person is serving 3years for stealing a mobile phone in Uganda. Does anything like this occur here in America? Also please read this essay from Marshall Project. Do you think this is accurate?...
-
In a frustrated response to the conduct of religious fundamentalist TLM students, a group of social activist high school students calling themselves "National Organization for Students Against...
-
The Salvation Army is being sued because of an accident that occurring during a Salvation Army summer camp in which a child in the camp nearly drowned. After the accident, the Salvation Army...
-
Insurance expired during the year is $7,300. Supplies remaining on hand at the end of the year equal $3,200. Provide services of $12,100 related to cash paid in advance by customers. Require......
-
Need answers in python1)string_immutable = 'jhonson'print(string_immutable)print(string_immutable[3])string_immutable[3] = 'y'2)set_immutable = set([1,2,3,4])print(set_immutable[2])3)set_im 2 answers
-
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...
-
Derive the frequency equation for the longitudinal vibration of the systems shown in Fig. 8.28. M p. A, E.1 p.A. E,I M k p. A. E,I ell M k (a) (b) FIGURE 8.28 Bar with different end conditions. (c)
-
Fill in the Blank. The ____________ energy of a beam is denoted by \(\frac{1}{2} \int_{0}^{l} E I\left(\frac{\partial^{2} w}{\partial x^{2}} ight)^{2} d x\).
-
A thin bar of length \(l\) and mass \(m\) is clamped at one end and free at the other. What mass \(M\) must be attached to the free end in order to decrease the fundamental frequency of longitudinal...
Study smarter with the SolutionInn App