[10 marks] Your task Is to write a program that determines how similiar a user's name...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
[10 marks] Your task Is to write a program that determines how "similiar" a user's name (first and last name) is to your name. A user's name will be assigned a score based on how similar their name is to yours, using the foilowing scoring system: • Beginning similarity: o When the first 3 letters of their name are the same as yours, they get 8 polnts. o When only the first two letters are the same, they get 3 points. o When only the first letter is the same, they get 2 points. o When none of these conditions apply, they get 0 points. • Ending similarity: o When the last two letters of their name are the same as yours, they get 6 points. o When just the last letter is the same, they get 3 points. o When none of these conditions apply, they get 0 points. • Length similarity: o When the length of their name is exactly the same as yours, they get 8 points, otherwise, they get 0 points. o When the length of their name is less than yours, their entire score becomes negative. For example, if my name was "Joe Smith" and the user entered the name "Jane Doe", their score would be -2, as they would get 2 points for beginning similarity, O points for ending similarity, and their score becomes negative since their name is shorter than mine (my name length is 8, theirs is 7). Write a program that does the following: 1. Asks the user for their name. 2. Calculates their score based on the above criteria. 3. Reports to the user what score they got. Submission instructions: • Your program must include a comment at the top with your name and the question number. Your file name should be either final_q1_INITIAL_LASTNAME.sb3 or final q1_INITIAL LASTNAME.py (eg., if your name is Rob Allen, your submission would be final_q1_R_Allen.sb3 or final_q1_R Allen.py) [10 marks] Your task Is to write a program that determines how "similiar" a user's name (first and last name) is to your name. A user's name will be assigned a score based on how similar their name is to yours, using the foilowing scoring system: • Beginning similarity: o When the first 3 letters of their name are the same as yours, they get 8 polnts. o When only the first two letters are the same, they get 3 points. o When only the first letter is the same, they get 2 points. o When none of these conditions apply, they get 0 points. • Ending similarity: o When the last two letters of their name are the same as yours, they get 6 points. o When just the last letter is the same, they get 3 points. o When none of these conditions apply, they get 0 points. • Length similarity: o When the length of their name is exactly the same as yours, they get 8 points, otherwise, they get 0 points. o When the length of their name is less than yours, their entire score becomes negative. For example, if my name was "Joe Smith" and the user entered the name "Jane Doe", their score would be -2, as they would get 2 points for beginning similarity, O points for ending similarity, and their score becomes negative since their name is shorter than mine (my name length is 8, theirs is 7). Write a program that does the following: 1. Asks the user for their name. 2. Calculates their score based on the above criteria. 3. Reports to the user what score they got. Submission instructions: • Your program must include a comment at the top with your name and the question number. Your file name should be either final_q1_INITIAL_LASTNAME.sb3 or final q1_INITIAL LASTNAME.py (eg., if your name is Rob Allen, your submission would be final_q1_R_Allen.sb3 or final_q1_R Allen.py)
Expert Answer:
Answer rating: 100% (QA)
Below you can find the code Snapshots of the code WORKING CODE IN C include using namespace std int ... View the full answer
Related Book For
Organic Chemistry
ISBN: 978-1118133576
11th edition
Authors: Graham Solomons, Craig Fryhle, Scott Snyder
Posted Date:
Students also viewed these databases questions
-
Your task is to write a program that will sequentially print the command line arguments to a program, with each argument on a new line. If no arguments have been provided, print this message and exit...
-
Your task is to write a program that will sequentially print the command line arguments to a program, with each argument on a new line. If no arguments have been provided, print this message and exit...
-
Your task is to prepare isopropyl methyl ether by one of the following reactions. Which reaction would give the better yield? Explain your answer. (1) Isopropyl methyl ether Or (2) Isopropyl methyl...
-
What is the "ALDI Way" and what was its quest? Take out costs; eliminate complexity Survival; make enough money to pay overhead costs Increase market share; find more prospective customers Build...
-
How can considering multiple judgment frames enhance an auditor's professional skepticism? Explain and give an example.
-
2- Click here to read the eBook: Internal Rate of Return (IRR) IRR Project L costs $69,995.78, its expected cash inflows are $14,000 per year for 10 years, and its WACC is 12%. What is the project's...
-
Use the following information regarding the Hamilton Corporation to prepare a statement of cash flows using the indirect method: Accounts payable decrease. Accounts receivable increase. Wages payable...
-
Based on a Comcast survey, there is a 0.8 probability that a randomly selected adult will watch prime-time TV live, instead of online, on DVR, etc. Assume that seven adults are randomly selected, and...
-
" B " is a large telecommunication company with a presence in many countries worldwide on three continents. In Saudi Arabia, the headquarter is located in Riyadh, with different departments or...
-
Bong, Harry and Mallu formed a partnership to carry on the business of an ethnic store in Bangkok. They are to receive equal shares of the profits and can make drawings during a year, not exceeding...
-
Skylar Ross, March 2021 The recent growth of the e-commerce industry has transformed the global marketplace. According to Digital Commerce 360, consumers spent $861.02 billion on online shopping in...
-
1, The effective rate of interest r earned by an investment can be defined by the formula r = where P is the initial investment, in dollars, that grows to a value of A after n years. Determine the...
-
19. A 0.20-kg stone is held 1.3 m above the top edge of a water well and then dropped into it. The well has a depth of 5.0 m. Taking y = 0 at the top edge of the well, what is the gravitational...
-
ForCo, a foreign corporation not engaged in a U . S . trade or business, recognizes a $ 3 million gain from the sale of land located in the United States. The amount realized on the sale was $ 5 0...
-
1. Facebook or LinkedIn? Which one would you prefer more and Why? 2. Does LinkedIn have a privacy policy? How far the privacy policy of both the rivals have affected the private lives of a consumer?...
-
Based on the following data for the current year, what is the days' sales in receivables? Assume 365 days a year. Sales on account during year $420,711 Cost of goods sold during year 209,962 Accounts...
-
Question: We are given the following information relating to options on Oracle stock: 3 0 - day call options on Oracle with a strike price of $ 9 5 were priced at $ 7 ( premium ) 3 0 - day put...
-
This problem continues the Draper Consulting, Inc., situation from Problem 12-45 of Chapter 12. In October, Draper has the following transactions related to its common shares: Oct 1 Draper...
-
What experimental conditions would favor the cyclization process in an intramolecular aldol reaction over intermolecular condensation?
-
(a) How many signals would you expect to find in the 1H NMR spectrum of caffeine? (b) What characteristic peaks would you expect to find in the IR spectrum of caffeine? CH3 CH3 Caffeine
-
Write a detailed mechanism for the following reaction. OH OH H2SO4 (cat), H2O HO OH
-
The economic theory supporting policies of income redistribution is derived from the principle of _________.
-
Political and social changes in the past century or two have worked to _________ income inequality.
-
Diminishing marginal utility implies that increases in income generate _________ additional happiness or utility at higher levels of income.
Study smarter with the SolutionInn App