【问题标题】:Pseudocode Flowchart伪代码流程图
【发布时间】:2019-08-04 15:49:32
【问题描述】:

因此,对于我在 12 年级开始之前的 A Level 计算机科学暑期任务,我得到了一项任务,我必须将流程图转换为伪代码。

这是任务:https://www.leggott.ac.uk/wp-content/uploads/2019/07/SummerTask-JLC-Programming.pdf

到目前为止,我得到了这个:

// checking the patient's skin condition
skin_condition = input "Does skin appear normal? (Y/N)"

if skin_condition = N then
    output "check pulse, call doctor"
endif
    respiratory_status = input "Is the paitent breathing normally? (Y/N)"

// checking the patient's respiratory staus

if respiratory_status = N then
    output "check for obstructions, call doctor"
endif
    temperature = input "What is the patients body temperature?"

// checking the patient's body temperature

if temperature < 95 then
    output "add additional blankets to warm patient"
endif
    neurological_status = input "Can the patient move or respond? (Y/N)"

// checking the patient's neurological status

if neurological_status = N then
    output "check consciousness, call doctor"
endif
    cardiovascular_status = input "Does the patient have a normal pulse rate? (Y/N)"

// checking the patient's cardiovascular status

if cardiovascular_status = N then
    output "check consciousness, call doctor"
endif
    output "monitor patient every hour or as necessary"

【问题讨论】:

    标签: pseudocode


    【解决方案1】:

    我想你已经大致了解了。只是几点:

    1. 您从未在使用之前设置skin_condition

    2. 您在流程图中要求输入之前要求输入(例如,respiratory_status)。当您到达图表中的那个点时提出问题。

    【讨论】:

    • 我确实设置了 skin_condition 我只是忘了复制和粘贴它谢谢你让我意识到哈哈。我做了一些更改:// skin condition skin_condition = input "Does skin appear normal? (Y/N)" if skin_condition = N then output "check pulse, call doctor" endif output respiratory_status // respiratory staus respiratory_status = input "Is the paitent breathing normally? (Y/N)" if respiratory_status = N then output "check for obstructions, call doctor" endif output temperature 无法粘贴整个内容,但这给出了想法
    • 我建议您使用标签下方的edit 按钮编辑您的问题,并包含您的更新信息。
    • 谢谢,刚刚完成了 - 关于我应该从哪里开始的意见或我可以添加的任何内容以使伪代码更有趣?
    • 表示例如的行在您获得这些值之前,“输出呼吸状态”、“输出神经状态”可能应该被消除。但我不知道如何使伪代码(或真正的代码,就此而言)“有趣”。
    • 我做了另一个编辑,考虑到你所说的,它会这样工作吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多