Menu

[Solved]Supposing Celebrities Care Privacy Much Programming Course Grades Hope Email Address Cell Q37177918

Supposing we are all celebrities who care about our privacy asmuch as our programming course grades….we hope our email addressand cell phone number are masked if we type them online. Now youneed to write a python/java code to realize this maskingfunction.

Requirement: (1) Assuming the input email address is in theformat of “name1@name2.name3”, all names must be converted tolowercase and all letters between the first and last letter of thename1 must be replaced by 6 asterisks ‘ * ‘. length of all names isno smaller than 2.

(2) A cellphone number is a string consisting of only the digits0-9 or the characters from the set {‘+’, ‘-‘, ‘(‘, ‘)’, ‘ ‘}. Youmay assume a phone number contains 10 to 13 digits. The last 10digits make up the local number, while the digits before those makeup the country code. Note that the country code is optional. Wewant to expose only the last 4 digits and mask all other digits.The local number should be formatted and masked as “***-***-1111”,where 1 represents the exposed digits.

To mask a phone number with country code like “+111 111 1111111″we write it in the form “+***-***-***-1111”. The ‘+’ sign andthe first ‘-‘ sign before the local number should only exist ifthere is a country code. For example, a 12 digit phone number maskshould start with “+**-“.

Note that extraneous characters like “(“, “)”, ” “, as well asextra dashes or plus signs not part of the above formatting schemeshould be removed. Phone number has length at least 10.

Example 1:

Input: “Yfan61@asu.edu”

Output: “y*****1@asu.edu” —->noticing that Y becomes y

Example 2:

Input: “CapMarvel@Kree.planet”

Output: “c*****l@kree.planet”

Example 3:

Input: “86-(01)12345678”

Output: “+**-***-***-5678” –> 12 digits, 2 digits forcountry code and 10 digits for local number

Example 4:

Input: “(312)664-7881”

Output: “***-***-7881” –> 10 digits, which means all digitsmake up the local number

Expert Answer


Answer to Supposing we are all celebrities who care about our privacy as much as our programming course grades….we hope our emai… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *