clc;clearC1 = input('Please enter a code to break: ' , 's');if length(C1) ~= 6 disp('Decoy message: Not a six-digit number.');else A = mod(sum(C1 - '0'),2);end if A == 1 disp('Decoy message: Sum is odd.') else C2 = (C1(1) - '0') * (C1(2) - '0') - (C1(3) - '0'); end switch C2 case 1 disp('Rescue on Monday') case 2 disp('Rescue on Tuesday') case 3 disp('Rescue on Wednesday') case 4 disp('Rescue on Thursday') case 5 disp('Rescue on Friday') case 6 disp('Rescue on Saturday') case 7 disp('Rescue on Sunday') otherwise disp('Decoy message:Invalid rescue day.'); end F1 = str2num(C1(4)); F2 = str2num(C1(5)); F3 = str2num(C1(6));if mod(F1,3) == 0 B = F2 - F3;else B = F3 - F2;endswitch(B) case 1 disp('at the bridge.'); case 2 disp('at the library.'); case 3 disp('at the river crossing.'); case 4 disp('at the airport.'); case 5 disp('at the bus terminal.'); case 6 disp('at the hospital.'); case 7 disp('at the St. Petes Church.'); otherwise disp('Decoy message:Invalid rendezvous point.');end
If we run this Script and enter 510129,it will appear:
Please enter a code to break: 510129
Rescue on Friday
at the St. Petes Church.
But I would like to make it appear :
Please enter a code to break: 510129
Rescue on Friday at the St. Petes Church.
How do I do that?
Best Answer