3 E D 80% Program #2 Conceal numbers in a string This program should replace all digits (numbers 0-9) in an user string

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

3 E D 80% Program #2 Conceal numbers in a string This program should replace all digits (numbers 0-9) in an user string

Post by answerhappygod »

3 E D 80 Program 2 Conceal Numbers In A String This Program Should Replace All Digits Numbers 0 9 In An User String 1
3 E D 80 Program 2 Conceal Numbers In A String This Program Should Replace All Digits Numbers 0 9 In An User String 1 (33.97 KiB) Viewed 36 times
3 E D 80% Program #2 Conceal numbers in a string This program should replace all digits (numbers 0-9) in an user string with a replacement string In the main part of the program: 1. Input the replacement string 2. Input the user string to edit 3. Print the user string 4. Call a function that takes the user string and replacement string as arguments, and replaces any digits in the user string with the replacement string. Since the original string is immutable, the modified string is a new object and must be returned from the function In the function A. Replace all digits in the user string with the replacement string B. Return the modified string After the function returns and back in the main part of the program 6. Prist the modified string Figure out the necessary prompts for the inputs and the desired outputs by looking at this example session. Text in red is a possible set of inputs and is not what you print out Enter the replacement string>X Enter the string to edit 55 123-45-6789 Original string SS: 123-45-6789 Modified string SS: XXXXX-XX-XXXX HINTS: (names in capital letters should be replaced by appropriate variable and function names) 1. This code might appear in your function TUBERSTRENGE))) ERSTRING LE USERSTRING.replace(at(1), REPLACESTRING> (assuming iisa for loup index and USERSTRING was what you called the user string parameter) 2. Remember to return the modified string (the original parameter is immutable and does not get changed, so for the main part of the programs to see the result you must return the result) 3. In the main part of the program, remember to use the return of the finition, either NEWSTRING-FUNCTIONNAME(OLDSTRING REPLACESTRING) OR USERSTRING-FUNCTIONNAME(USERSTRING, REPLACESTRING) (to "rease the original string same Think about what you needed to da differently in Program 2 because stringi immutable, whereas in Program #altable Search or type URL 35 9 4 8 9 T C 20 R F 5 V G B Y H U N J 1 M K 0
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply