Develop an algorithm, using either pseudo-code or a flowchart, that:
validCode to FalsevalidCode to True if the string contained in the variable pCode is exactly 2 characters in length, begins with an uppercase P, and has a single numeric digit as its second characterExamples:
pCode is "P4" or "P0", then validCode should be TruepCode is "p4", "Px", or "P42", then validCode should be FalseYou may wish to use the following in your answer:
isDigit(ch) which returns True if the character ch is a digit (e.g., "0" to "9") and False otherwise.length(string) which returns the number of characters in a string.