Question: 1. Write a function decode that takes a String and processes it in the following way: The function should scan each letter of the String

1. Write a function decode that takes a String and processes it in the following way: The function should scan each letter of the String in turn. If the letter is '1', then nothing is output to Serial. If it is a '0', then a space is output to Serial. Otherwise (i.e., not a 'O' or '1'), the letter is output to Serial. Include comments in your code to explain what is happening. Examples are below. [20 marks) // in your setup() function String message1 "111111THIS111011111151110110111"; message1+="COD111ED1101111MESSA1G11E1"; String message2="11CA1110111701111111 11"; message2+="UODE111C011DE110111TH11111S1?1"; decode (message1); //Prints to Serial: THIS IS A CODED MESSAGE decode (message2); //Prints to Serial: CAN YOU DECODE THIS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
