Geeks With Blogs
Melanie Draves programming and what not

Before I program solutions, I like to write pseudo-code to plan out the steps that I intend to take!

The following is my plan for the Hospital Charges program


Program: Hospital Charges
Name:  Melanie Draves
Date:  Feb 26 2012

 Narrative Description:
Program will calculate the total cost for a patient's hospital stay.  Calculation variables include:
 number of days of hospital stay
 medication charges incurred
 surgical charges incurred
 lab charges incurred
 physical rehabilitation charges incurred
Program will calculate totals using the following methods:

 CalcStayCharges  = $350 * number of days of hospital stay
 CalcMiscCharges  = medication charges incurred + surgical charges incurred + lab charges incurred + medical rehabilitation charges incurred
 CalcTotalCharges = CalcStayCharges + CalcMiscCharges

 numdays -  int
 medchrg -  real
 srgchrg -  real
 labchrg -  real
 rehbchrg - real
 totcost -  real
 staychrg - real
 miscchrg - real

 get inputs
 calc tot's
  staychrg = CalcStayCharges(numdays)
  miscchrg = CalcMiscCharges(medchrg, srgchrg, labchrg, rehbchrg)
  totcost  = CalcTotalCharges()
 display tot's
method CalcTotalCharges(real lstaychrg, real lmiscchrg)
ret ltotcost - real
 ltotcost = lstaychrg + lmiscchrg

method CalcMiscCharges(real lmedchrg, real lsrgchrg, real llabchrg, real lrehbchrg)
ret: lmiscchrg - real
 lmiscchrg = lmedchrg + lsrgchrg + llabchrg + lrehbchrg
method CalcStayCharges(int lnumdays)
ret: lstaychrg - real
 lstaychrg = 350 * lnumdays


Posted on Sunday, March 4, 2012 6:30 PM Beginning C# | Back to top

Comments on this post: Hospital Charges program - Pseudo-code

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © MoDraves | Powered by: