Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 393971

Submitted on 30 Jan 2014 by Sourabh

Correct

10Size
This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
s='abcde?fgh123ij';
s_correct='abcdX?fgh123iX';
assert(isequal(string_furlough(s),s_correct))
ans =
     []
2
Pass
 
%%
s='non-essential personnel'
s_correct = 'non-eXsentXal peXsonnXl';
assert(isequal(string_furlough(s),s_correct))
s =
non-essential personnel
ans =
     []
3
Pass
 
%%
s='The furloughs will continue until morale improves.'
s_correct = 'The fXrlouXhs wiXl conXinue Xntil XoralX imprXves.';
assert(isequal(string_furlough(s),s_correct))
s =
The furloughs will continue until morale improves.
ans =
     []
4
Pass
 
%%
s='Who doesn''t like a 20% pay cut?'
s_correct='Who dXesn''t Xike a 20% Xay cuX?'
assert(isequal(string_furlough(s),s_correct))
s =
Who doesn't like a 20% pay cut?
s_correct =
Who dXesn't Xike a 20% Xay cuX?
ans =
     []
5
Pass
 
%%
s='The quick brown fox jumps over the lazy dog.'
s_correct = 'The qXick bXown fXx jumXs oveX the lXzy doX.';
assert(isequal(string_furlough(s),s_correct))
s =
The quick brown fox jumps over the lazy dog.
ans =
     []
6
Pass
 
%%
s='A-B-C.  Easy as 1-2-3.';
s_correct = 'A-B-C.  EXsy as 1-2-3.';
assert(isequal(string_furlough(s),s_correct))
ans =
     []
7
Pass
 
%%
s='My single favorite TV show is X-Files!';
s_correct='My siXgle fXvoriXe TV sXow is X-FileX!';
assert(isequal(string_furlough(s),s_correct))
ans =
     []