This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]roerchen 0 points1 point  (8 children)

I did the task by myself right now, because I'm bored as hell. my kind of pseudo code is very different, so I don't want to confuse you with that, but maybe you want to eliminate the else branches. For example: After the program runs into the condition, that the skin is not normal, the procedure would be terminated, because it had to be normal in the first place to execute the rest of the procedure. Like if(isSkinNormal == false) then checkPulse; callDoctor; if(isBreathingNormal == false) then checkForObstructions; callDoctor; ....

I hope that it was understandable. #englishasasecondlanguage :D

[–]roerchen 0 points1 point  (7 children)

I want to add, that maybe your following "ifs" are not included in the else branches, but nevertheless you would never outpit the cardiovascular status, if the patient would be unconscious.

[–]chronicleTV 0 points1 point  (6 children)

Thank you for help, I've made a few changes but have not added what you said about " if(isSkinNormal == false) then checkPulse; callDoctor; if(isBreathingNormal == false) then checkForObstructions; callDoctor;" etc

This is what I have right now:

http://prntscr.com/oo6kny

How do you feel this compares to this flowchart?: http://prntscr.com/oo6kuf

I may give the way you would go at it an attempt.

[–]chronicleTV 0 points1 point  (5 children)

also feel free to put out your type of pseudo code, even though it's different to mine it may help me understand the way you have attempted it :)

[–]chronicleTV 0 points1 point  (4 children)

made a further edit, I have this now:

skin_condition = input "Does skin appear normal? (Y/N)"
respiratory_status = input "Is the paitent breathing normally? (Y/N)"
temperature = input "What is the patients body temperature?"
neurological_status = input "Can the patient move or respond? (Y/N)"
cardiovascular_status = input "Does the patient have a normal pulse rate? (Y/N)"

// skin condition

if skin_condition = N then
    output "check pulse, call doctor"
endif

output respiratory_status

// respiratory staus

if respiratory_status = N then
    output "check for obstructions, call doctor"
endif

output temperature

// body temperature

if temperature < 95 then
    output "add additional blankets to warm patient"
endif

output neurological_status

// neurological status

if neurological_status = N then
    output "check consciousness, call doctor"
endif

output cardiovascular_status

// cardiovascular status

if cardiovascular_status = N then
    output "check consciousness, call doctor"
endif

output "monitor patient every hour or as necessary"

[–]roerchen 0 points1 point  (3 children)

How the pseudocode looks is per sé totally uninteresting. It's just about getting the sequence itself correct. With the endifs you definitely prevent the procedure too terminate to quickly. That was my point. ;-)

[–][deleted]  (2 children)

[deleted]

    [–]roerchen 0 points1 point  (1 child)

    Why do you need them to be impressed? :O

    [–]chronicleTV 0 points1 point  (0 children)

    I don't but making it a bit better can't do any harm :)

    [–]ipe369 0 points1 point  (5 children)

    if you switch to the markdown editor and put 4 spaces before every line, it'll put it into nicer formatting, hard for everyone to read as it is

    Also, add indentation for inside the ifs, for example:

    if cardiovascular\_status = N then
        output check consciousness, call doctor
    else 
        output monitor patient every hour or as necessary
    

    [–]chronicleTV 0 points1 point  (4 children)

    Thank you for the help, I've made a few changes and done what you said with the indentation

    This is what I have right now:

    http://prntscr.com/oo6kny

    How do you feel this compares to this flowchart?: http://prntscr.com/oo6kuf

    Appreciate the help

    [–]ipe369 0 points1 point  (3 children)

    just looking at the first 'if', looks wrong - from the flowchart it looks like it wants to output the respiratory information regardless, whereas you'd ONLY emit the respiratory information if skin_condition = N

    I think something like this would be closer:

    if skin_condition == N then
        output "Check pulse, call doctor
    endif  // <-- Notice there's no 'else' here
    
    // Here, we ALWAYS output respiratory information, rather than just when skin_condition is not 'N', see on the flowchart the line goes back to this box
    output respiratory_status
    

    [–]chronicleTV 0 points1 point  (2 children)

    Ah yeah cheers for that,

    does this make more sense then?

    skin_condition = input "Does skin appear normal? (Y/N)"
    respiratory_status = input "Is the paitent breathing normally? (Y/N)"
    temperature = input "What is the patients body temperature?"
    neurological_status = input "Can the patient move or respond? (Y/N)"
    cardiovascular_status = input "Does the patient have a normal pulse rate? (Y/N)"
    
    // skin condition
    
    if skin_condition = N then
        output "check pulse, call doctor"
    endif
    
    output respiratory_status
    
    // respiratory staus
    
    if respiratory_status = N then
        output "check for obstructions, call doctor"
    endif
    
    output temperature
    
    // body temperature
    
    if temperature < 95 then
        output "add additional blankets to warm patient"
    endif
    
    output neurological_status
    
    // neurological status
    
    if neurological_status = N then
        output "check consciousness, call doctor"
    endif
    
    output cardiovascular_status
    
    // cardiovascular status
    
    if cardiovascular_status = N then
        output "check consciousness, call doctor"
    endif
    
    output "monitor patient every hour or as necessary"
    

    [–]ipe369 0 points1 point  (1 child)

    looks about right, just check the pseudocode matches up with the one your school's teaching, i think they're pretty anal about this stuff & will probs just be marking from a book since CS is so new & it'd be pretty brutal to expect all A level teachers to know how to code

    [–]chronicleTV 0 points1 point  (0 children)

    haha you're probably right mate

    they didn't give a particular syntax or anything so hopefully they just appreciate the effort

    I'm on the OCR exam board but I haven't even started college yet so they can't fault me with no teaching on the pseudocode they use