Hi. I'm trying to convert my python file into pseudo code but I have no idea of how pseudo code work.

continueAnswer = input("Please enter either continue to carry on with the program or end to stop it: ")
continueAnswer=continueAnswer.upper()
while continueAnswer == 'C':
    while True:
        try:
            print('')
            encodeORdecode = input("Type E for encode or D for decode: ")
            if encodeORdecode != 'e' and encodeORdecode != 'd' and endChoice !='END' and endChoice !='NO':
                raise ValueError
            break
        except ValueError:
            print("Invalid Choice!! Please try again")

    step=int(input("Plese enter a number for what you want the offset to be: "))
    #working
    #encoding
    if encodeORdecode == 'e':
        userInput=input("Please enter the message you want to encode: ")
        userInput = userInput.lower()
        for x in range(0,len(userInput),1):
            encoded = chr(ord(userInput[x])+step)
            print(encoded.upper(), end = '')
        print('')
        continueAnswer = input("Do you want to continue or end the program: ")
        continueAnswer=continueAnswer.upper()
    # decoding

    if encodeORdecode == 'd':
        userInput=input("Please enter the message you want to decode: ")
        userInput = userInput.lower()
        for x in range(0,len(userInput),1):
            encoded = chr(ord(userInput[x])-step)
            print(encoded.upper(), end = '')
        print('')
        continueAnswer = input("Do you want to continue or end the program: ")
        continueAnswer=continueAnswer.upper()
#ending program
while continueAnswer == 'END':
    print('۞۞۞Now ending program. Thanks for using my programs guys۞۞۞')
    break

Edited 1 Year Ago by Jon_4: misspelling

Pseudo-code doesn't work; that's the whole point of it. It is a higher-level description of a problem without the details that would make it a running program. Pseudo-code isn't a specific language - it is just a description of the program in a way that resembles actual code, but omits the details. There is no specific syntax or rules for pseudo-code, you make it up as you go along.

If you don't mind me asking, why do you need pseudo-code for a program that already exists? Usually one writes the pseudo-code first, and then uses that as the design for the actual program, not the other way around. Did you assignment call for you to lay out a design in pseudo-code, and then write the program? If so, how did you come to skip that step?

Edited 1 Year Ago by Schol-R-LEA

This article has been dead for over six months. Start a new discussion instead.