Cody

Problem 43661. Use R2016b Text Manipulations to Fix These Addresses (Part 2)

Solution 1696656

Submitted on 19 Dec 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = '950 Blue Hill Ave.Dorchester, MA 2124'; y = string('950 Blue Hill Ave.Dorchester, MA 02124'); assert (all(y == myFun(x)));

b = 33

Undefined function or variable 'adr'. Error in myFun (line 3) adrOut = [adrIn(1:b) '0' adr(b+1:end)] Error in Test1 (line 3) assert (all(y == myFun(x)));

2   Fail
x = '259 Allandale Rd.Jamaica Plain, MA 2467'; y = string('259 Allandale Rd.Jamaica Plain, MA 02467'); assert (all(y == myFun(x)));

b = 35

Undefined function or variable 'adr'. Error in myFun (line 3) adrOut = [adrIn(1:b) '0' adr(b+1:end)] Error in Test2 (line 3) assert (all(y == myFun(x)));

3   Fail
x = '850 Harrison Ave.Boston, MA 2118'; y = string('850 Harrison Ave.Boston, MA 02118'); assert (all(y == myFun(x)));

b = 28

Undefined function or variable 'adr'. Error in myFun (line 3) adrOut = [adrIn(1:b) '0' adr(b+1:end)] Error in Test3 (line 3) assert (all(y == myFun(x)));

4   Fail
x = '23-29 Tucker St.Dorchester, MA 2124'; y = string('23-29 Tucker St.Dorchester, MA 02124'); assert (all(y == myFun(x)));

b = 31

Undefined function or variable 'adr'. Error in myFun (line 3) adrOut = [adrIn(1:b) '0' adr(b+1:end)] Error in Test4 (line 3) assert (all(y == myFun(x)));