One day Shanto asked Saima how much she loves him. Saima's answer was 71.43%, which, unsurprisingly,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
One day Shanto asked Saima how much she loves him. Saima's answer was "71.43%", which, unsurprisingly, shocked Shanto. Why didn't she say something like "for the full 100% !", and why a particular and peculiar percentage like 71.43? Looking at Shanto's surprised, shocked and nervous face, she burst out laughing and told that she loves him more than any thing in this universe and it was nothing but a silly and funny love calculation. Then she described Shanto the calculation. There's a lot of online relationship advice, through answering quizzes, one's horoscope sign compatibility and whatnot. You are going to add yours, based on Saima's calculation. You will have to write a program so that any one can calculate love between any two persons very quickly. Rules: You will be given two names. These two names can have white space or some other non-alphabetical characters like $ & % etc. But only the alphabets from a to z or A to Z will participate in love calculation. Each alphabet has a particular value. The values are from 1 to 26 in ascending order of the alphabets. It's like this: a = 1, b = 2, c = 3, ..., z = 26. Both upper case and lower case holds the same values. Then make the sum of these numbers until it comes in one digit. For example, consider a name 'bcz'. Here, b = 2, c = 3 and z = 26. So, the sum is (2+3+26) = 31 = (3+1) = 4. Then the ratio of these two numbers in percentage will be the result. Remember: The result cannot be more than 100%, so make sure to take the ratio carefully to avoid this problem. Input Your input will be two names. Each name holds not more than 25 characters. End of file will indicate the end of input. Output For each pair of names, your program will have to calculate the love between those two persons' names and give the result as output. In the result, two digits are to be displayed after the decimal point. All the results must be on new lines. Sample input saima shanto Pakistan India USA USSR Sample output 71.43% 100.00 % 100.00 % One day Shanto asked Saima how much she loves him. Saima's answer was "71.43%", which, unsurprisingly, shocked Shanto. Why didn't she say something like "for the full 100% !", and why a particular and peculiar percentage like 71.43? Looking at Shanto's surprised, shocked and nervous face, she burst out laughing and told that she loves him more than any thing in this universe and it was nothing but a silly and funny love calculation. Then she described Shanto the calculation. There's a lot of online relationship advice, through answering quizzes, one's horoscope sign compatibility and whatnot. You are going to add yours, based on Saima's calculation. You will have to write a program so that any one can calculate love between any two persons very quickly. Rules: You will be given two names. These two names can have white space or some other non-alphabetical characters like $ & % etc. But only the alphabets from a to z or A to Z will participate in love calculation. Each alphabet has a particular value. The values are from 1 to 26 in ascending order of the alphabets. It's like this: a = 1, b = 2, c = 3, ..., z = 26. Both upper case and lower case holds the same values. Then make the sum of these numbers until it comes in one digit. For example, consider a name 'bcz'. Here, b = 2, c = 3 and z = 26. So, the sum is (2+3+26) = 31 = (3+1) = 4. Then the ratio of these two numbers in percentage will be the result. Remember: The result cannot be more than 100%, so make sure to take the ratio carefully to avoid this problem. Input Your input will be two names. Each name holds not more than 25 characters. End of file will indicate the end of input. Output For each pair of names, your program will have to calculate the love between those two persons' names and give the result as output. In the result, two digits are to be displayed after the decimal point. All the results must be on new lines. Sample input saima shanto Pakistan India USA USSR Sample output 71.43% 100.00 % 100.00 %
Expert Answer:
Related Book For
Intermediate Accounting IFRS
ISBN: 978-1119372936
3rd edition
Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield
Posted Date:
Students also viewed these programming questions
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
I wrote Marketing plan about Apple Watch. Please read my plan and make Excutive summary based onmy plan. MARKETING STRATEGY Segmentation, Targeting, Positioning Positioning of Apples Series 3 Watch...
-
As programs become more complex, it becomes increasingly important to plan or "design" your code before writing it. Designing your code will help you organize its logic. It will also help you keep...
-
The proof of the Coase theorem requires that firms recognize both the explicit and implicit costs of their decision. Explain a situation where a firm's failure to curtail pollution may cause it to...
-
What is an Initial Public Offering (IPO), and how does it work? 2. What are the potential benefits for a company going public through an IPO? 3. What are some common reasons why companies decide to...
-
During its first year of operations, Atlas Travel earned revenue of $400,000 on account. Industry experience suggests that Atlas Travels uncollectible accounts will amount to 2% of revenues. On...
-
The following information is available for Bernard Corporation: Net income ................. $206,000 Decrease in accounts receivable ......... 4,900 Increase in inventory ............ 15,300...
-
From these websites: https://writingcommons.org/section/mindset/ https://www.psychologytoday.com/us/blog/click-here-happiness/201904/15-ways-build-growth-mindset What strikes you as most valuable in...
-
Cardinal Company is considering a five-year project that would require a $2,975,000 investment in equipment with a useful life of five years and no salvage value . The company's discount rate is 14%....
-
The City of Saskville sends about 5221 tonnes/month of MSW to its landfill. What landfill area (in m2) would be required for one year's worth of MSW if the waste density at the landfill is 780 kg/m3...
-
Find the derivator? 3 x (a) 3x - 2x - 1 id dx
-
3. Rank the following compounds in the order of increasing enthalpy of formation, and briefly EXPLAIN. A B D
-
1. View the following 3 TED Talks (video presentations). As youwatch the videos, take notes of any relevant information. Insidethe mind of a master procrastinator | Tim Urban The habits ofhighly...
-
What is the market value of one common share? Use the dividend discount model and make the following assumptions when solving this problem: A dividend of $2.50 at time period zero An 18% required...
-
Divide and simplify. x+8x+15x2-9 x+5 5x-15
-
Sleigh Bells Ringing Corp borrowed $ 10,000 on a ten month promissory note at 8% to be repaid in one lump sum. The funds were borrowed on September 1. What is the amount of accrued interest expense?...
-
Outline a general process applicable to most control situations. Using this, explain how you would develop a system to control home delivery staff at a local pizza shop.
-
Fosbre Corporations April 30 inventory was destroyed by fire. January 1 inventory was $150,000, and purchases for January through April totaled $500,000. Sales for the same period were $700,000....
-
On July 1, 2019, Wheeler AG purchased 4,000,000 of Duggen Company's 8% bonds, due on July 1, 2024. The bonds, which pay interest semiannually on January 1 and July 1, were purchased for 3,604,062 to...
-
Hasselback Company acquired a plant asset at the beginning of Year 1. The asset has an estimated service life of 5 years. An employee has prepared depreciation schedules for this asset using three...
-
Which of the following is true of audit sampling? a. A sample is less time-consuming and provides less assurance than examining all items in the population. b. A sample is less time-consuming and...
-
Which of the following best illustrates an error caused by sampling? a. A randomly chosen sample may not be representative of the population as a whole on the characteristic of interest. b. An...
-
The application of statistical sampling techniques is least related to which of the following generally accepted auditing standards? a. The work is to be adequately planned and assistants, if any,...
Study smarter with the SolutionInn App