Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[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.

  


      

[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)

Step by Step Solution

3.32 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

Below you can find the code Snapshots of the code WORKING CODE IN C include using namespace std int ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Organic Chemistry

Authors: Graham Solomons, Craig Fryhle, Scott Snyder

11th edition

1118133579, 978-1118133576

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago

Question

What is quality of work life ?

Answered: 1 week ago

Question

What happens if a team cant get past the storming stage?

Answered: 1 week ago