ChallengeToken and replaces every fourth character with an underscore to produce the final output.
String Challenge
Have the function StringChallenge(num) take the num parameter being passed and return the number of hours and minutes the parameter converts to (ie. if num = 63 then the output should be 1:3). Separate the number of hours and minutes with a colon.
Once your function is working, take the final output string and concatenate it with your ChallengeToken, and then replace every fourth character with an underscore.
Your ChallengeToken: 386emsol49
Examples
Input: 126
Output: 2:6
Final Output: 2:6_86e_sol_9
Input: 45
Output: 0:45
Final Output: 0:4_386_mso_49
---------------------------------------------------
Java code to implement the StringChallenge
function as described, along with the ChallengeToken concatenation and character replacement:
The StringChallenge
function first calculates the number of hours and minutes from the input num
, then converts them to a string in the format "hours
." After that, it concatenates the ChallengeToken and replaces every fourth character with an underscore to produce the final output.
Comments
Post a Comment