Write a program that have the following functions: A main function that read a person first...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that have the following functions: A main function that read a person first and last name from keyboard. The main function calls the below functions. ● ● ● A function that takes first and last names and returns a set of the unique common letters in the first and last names (intersection). A function that takes first and last names and returns a set of all unique letters in the first and last names (union). A function that takes first and last names and returns a set of all unique letters in first name but not in last name and all unique letters in last name but not in first name (symmetric difference). Here is a sample run: Enter first name: Ernest Enter last name: Hemingway Intersection: {'e', 'n'} Union: {'m', 'i', 't', 'e', 'a', 'r', 'E', 'H', 'g', 'w', 'n', 's', 'y'} Symmetric: {'m', 'i', 'a', 'y', 't', 'r', 'E', 'H', 'g', 's', 'w'} Write a program that have the following functions: A main function that read a person first and last name from keyboard. The main function calls the below functions. ● ● ● A function that takes first and last names and returns a set of the unique common letters in the first and last names (intersection). A function that takes first and last names and returns a set of all unique letters in the first and last names (union). A function that takes first and last names and returns a set of all unique letters in first name but not in last name and all unique letters in last name but not in first name (symmetric difference). Here is a sample run: Enter first name: Ernest Enter last name: Hemingway Intersection: {'e', 'n'} Union: {'m', 'i', 't', 'e', 'a', 'r', 'E', 'H', 'g', 'w', 'n', 's', 'y'} Symmetric: {'m', 'i', 'a', 'y', 't', 'r', 'E', 'H', 'g', 's', 'w'}
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that fulfills the requirements youve described def getintersectionfirstname l... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The following are trial balance of Clarissa Amanda Sdn. Bhd. as at 31st December 2021. Debit RM Credit RM Opening stock, 1 Jan 2021 16,000 Purchases 75,000 Sales return 5,000 Carriage inwards 1,500...
-
Ivanhoe Company incurred research and development costs of $ 9 0 0 0 0 to develop a patent, and legal fees of $ 3 0 0 0 0 to register the patent. The patent has a legal life of 2 0 years and a useful...
-
A man drops a stone from a high bridge and hears it strike the water below exactly 4 s later. (a) Estimate the distance to the water based on the assumption that the travel time for the sound to...
-
What is (NPV)?
-
The average North American loses an average of 15 days per year to colds and flu. The natural remedy Echinacea reputedly boosts the immune system. One manufacturer of Echinacea pills claims that...
-
Could an extend use case have an include use case? Explain.
-
Comparative data from the balance sheet of BlackBerry Limited are shown below. Instructions (a) Using horizontal analysis, calculate the percentage change between 2014 and 2015. (b) Using vertical...
-
What are the advantages and disadvantages of divesting through an asset sale or through a spin-off? In your opinion, did Northrop Grumman make the right choice in pursuing a spin-off?
-
Get It Right, CPAs, has been retained to review its client's corporate formation calculations for 20XX. Maria, Roger, and Novak created Grassroots Tennis, Inc. (GTI), which began operations on March...
-
1) Draw the structure of the hydroxyaldehyde product from the self-aldol reaction of each of the following aldehydes: (a) propanal; (b) phenylethanal; (c) 3-phenylpropanal; (d) benzaldehyde. 2) Draw...
-
Calculate the contribution of foreign currency to the Bhatt accounts total return. Show your calculations. Darden meets with Bhatt and learns that Bhatt will be moving back to his home country of...
-
The Caribou Fund is most likely classified as a: A. large-cap value fund. B. small-cap value fund. C. small-cap growth fund. Three years ago, the Albright Investment Management Company (Albright)...
-
Identify the most likely approach for Lee to optimally locate Wilsons portfolio on the currency risk spectrum, consistent with the IPS. Justify your response with two reasons supporting the approach....
-
You are going to take a random sample of voters in a city in order to estimate the proportion who support stopping the uoridation of the municipal water supply. Before you analyze the data, you need...
-
Recommend the trading strategy C&M should implement. Justify your response. Mason Darden is an adviser at Colgate & McIntire (C&M), managing large-cap global equity separate accounts. C&Ms investment...
-
A converging-diverging tube is installed in between two water tanks to estimate the volume flow through the pipe with assumption of no losses. Based on the information given, address what is wrong...
-
Les has collected stamps in his spare time for years. He purchased many of his stamps at a price much lower than the current market value. Les recently lost his job as a carpenter. Since his wife...
-
Find the error(s) in the following recursive method, and explain how to correct it: static int Sum(int n) { if (n == 0) { return 0; } else { return n + Sum(n); } }
-
How can generic methods be overloaded?
-
A derived class can inherit interface or implementation from a base class. How do inheritance hierarchies designed for inheriting interface differ from those designed for inheriting implementation?
-
Allister Company uses both debt capital and equity capital to fund new projects. The before-tax cost of debt capital is 12 percent. The cost of equity capital is 10 percent. Allister's effective tax...
-
Use an Internet search engine to identify three companies or agencies that use present worth analysis to make business decisions as evidenced in their annual reports.
-
Use the Internet to access ConocoPhillips's most recent annual report. a. What evidence do you find that ConocoPhillips continues to rely on present worth analysis in its corporate decision making?...
Study smarter with the SolutionInn App