Secret Code
Secret Code
Back to the Program-A-Day homepage
ProblemSecret Code The following string of text has a secret code encrypted inside it: xmydartlkarrsgeoptwwjvbodeblxgbleivetoihewt
1) Extract every fourth letter of the string 2) Reverse the order of the extracted letters 3) Set the case of the extracted letters so that they alternate between uppercase and lowercase, with the first letter being uppercase.
1) You will need three string variables: - one called "message" to store the above string to be deciphered - one called "result1" to store the result after Step 1 - one called "secretCode" to store the results after Steps 2 and 3 2) The length(), charAt(), toUpper(), and toLower() methods 3) String concatenation 4) The mod operator |
SideSectionTitle
An image or By Students section | |
---|---|---|
SolutionThe solution... [SolutionCode = | ||
CodeSolutionCode goes here. Please DO NOT put your code in <pre> tags! |