Question: Instructions Write a program that reads in a line consisting of a Student's name, Social Security number, user ID, and password. The program outputs the

 Instructions Write a program that reads in a line consisting of

Instructions Write a program that reads in a line consisting of a Student's name, Social Security number, user ID, and password. The program outputs the string in which all the digits of the Social Security number and all the characters in the password are replaced by x. (The Social Security number is in the form DDD-BB-600, and the user ID and the password do not contain any spaces. Your program should not use the operator [] to access a string element. Use the appropriate functions described in Table 7.1 below. Expression Effect Str Varal[index) SLrVarfindex] Returns the element at the position specified by index Returns the element at the position specified by index Appends n copies of ch to strVar, where ch is a char variable or a char constant StrVar.appendin,ch) StrVar.append(s) Appends str lo str Var SLrVar.clear) Deletes all the characters in strVar SLrVar.compare(s) Str Varemply) Str Var.erasel StrVar.eraselpos, ni Returns 1 if strVar> str returns O if strVar -- str; returns-1 if strVar length of strVar, then all the characters until the end of strVar are replaced Returns a string which is a substring of strVar starting at pos. The length of the substring is at most len characters. Il len is too large, it means to the end of the string in sir Var Returns a value of type string-size type giving the number of characters in strVar Str Var.substripos, len Str Var.size) Str Varswap(sur 1) Swaps the contents of strVar and str1. str is a string variable

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!