Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started