Search code examples
pythonpseudocodeflowchart

How do I write this in pseudocode?


I'm currently studying JavaScript in Computer Science and just need a little help on my pseudocode as I'm getting confused. The task is to create a phone troubleshooting system in python. I have finished my basic flow chart for Task 1 but I'm now struggling to write it in pseudocode due to the excessive amount of questions. Can anyone guide me in the right direction?

Flow Chart: click here

My started Pseudocode:

START
OUTPUT ‘screen question1 here’
INPUT ‘user answer’
IF answer1 = ‘yes’ THEN
    OUTPUT ‘screen question2 here’
    INPUT ‘user answer’
ELSE
    OUTPUT ‘battery question1 here’
    INPUT ‘user answer’
IF answer2 = ‘yes’ THEN
    OUTPUT ‘screen question3 here’
ELSE

Thanks.


Solution

  • answeer=''
    answer2=''
    answer3=' '
    
    print ('screen question1 here')
    answer = input ('user answer')
    if answer=='yes':
        print ('screen question2 here')
        answer2 = input('user answer') 
    else:
        print ('battery question1 here')
        answer3 = input('user answer')
    
    if answer2 == 'yes':
        print ('screen question3 here')
    else:
        pass
    

    This is just an idea, the rest it's up to you.

    See this code working here.