Note that there are some explanatory texts on larger screens.

plurals
  1. POProgramming Pseudocode Nested if into Control Structure
    text
    copied!<p>Can anyone help me change this nested if into a control case, or something more efficient (just not loops)?</p> <p>Design a solution for the following problem, use modules where possible. Illustrate your solution with structured flowcharts and corresponding pseudocode.</p> <p>A health clinic has a payment schedule for any services provided which is as follows:</p> <p>a. If a patient is a first time patient with no insurance coverage, charges are to be paid in full at the time of service .</p> <p>b. If a patient is a first time patient with insurance coverage then one half of the charges are to be paid at the time of service and the balance billed on the monthly statement.</p> <p>c. If a patient is not a first time patient with no insurance coverage then one half of the charges are to be paid at the time of service and the balance billed on the monthly statement.</p> <p>d. If a patient is not a first time patient with insurance coverage then the all charges will be billed on the monthly statement.</p> <p>e. If a patient is a “preferred” patient with no insurance, one half of the charges are to be paid that the time of service and the balance billed on the monthly statement.</p> <p>f. If a patient is a “preferred” patient with insurance all charges will be billed on the monthly statement.</p> <hr> <pre><code> 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 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload