【发布时间】:2013-09-17 03:05:19
【问题描述】:
谁能帮我把这个嵌套的 if 改成控制用例,或者更有效的东西(只是不是循环)?
为以下问题设计一个解决方案,尽可能使用模块。用结构化流程图和相应的伪代码说明您的解决方案。
健康诊所对所提供的任何服务都有如下付款时间表:
一个。如果患者是没有保险的首次患者,则费用将在服务时全额支付。
b.如果患者是第一次有保险的患者,那么一半 服务费应在服务时支付,余额在 月结单。
c。如果患者不是第一次没有保险的患者,那么一半 费用的一部分将在服务时支付,余额将在 月结单。
d。如果患者不是第一次有保险的患者,那么所有 费用将在月结单上计费。
e。如果患者是没有保险的“首选”患者,则收取一半的费用 将支付服务时间和每月结算的余额 声明。
f。如果患者是有保险的“首选”患者,则所有费用都将在月结单上计费。
Start
Declare variables
Input(first,ins,pre)
if(first = 'T') then
if(ins = 'T') then
if(pre = 'T') then
Print('Monthly Statement')
else
Print('Pay one-half and Billed one-half')
endif
else
if(pre = 'T') then
Print('Pay one-half and Billed one-half')
else
Print('Pay full')
endif
endif
else
if(ins = 'T') then
if(pre = 'T') then
Print('Monthly Statement')
else
Print('Monthly Statement')
endif
else
if(pre = 'T') then
Print('Pay one-half and Billed one-half')
else
Print('Pay one-half and Billed one-half')
endif
endif
endif
Stop
【问题讨论】:
标签: pseudocode