Blog Stats
  • Posts - 9
  • Articles - 0
  • Comments - 3
  • Trackbacks - 0

 

Joe's Automotive program - Pseudo-code

Pseudo-code for Joe's Automotive program

/*

 pseudo-code
Program: Joe's Automotive
Name:  Melanie Draves
Date:  Feb 26 2012

 Narrative Description:
Program calculate and display a customer's total charges incurred for a visit to an automotive establishment.
Calculations for regular services are based on the following schedule:
 Inspection 15.00
 Lube job 18.00
 Tire rotation 20.00
 Oil change 26.00
 Radiator flush 30.00
 Trnsmissn flush 80.00
 Muffler replace 100.00
 nonroutine svc 20.00 * Hours worked
Calculations to be made by the following methods:
 (value-returning)
 totoillube = OilLubeChrgs Method for oil change and/or lube job
 totflush = FlushChrgs  Method for radiator flush and/or transmission flush
 totmisc = MiscChrgs  Method for inspection, muffler replacement, and/or tire rotation
 totother = OtherChrgs  Method for services/labor (if applicable)
 tottax = 0.06 * amt of parts Method for sales tax charged on parts
 totfees = TotalChrgs  Method for total charges
 (void methods) called when the user click 'Clear' button
 ClrOilLube Method for clearing oil change and lube job check boxes  
 ClrFlushes Method for clearing radiator and transmission flushes check boxes
 ClrMisc  Method for clearing inspection, muffler replacement, tire rotation check boxes
 ClrOther Method for clearing parts and labor text boxes
 ClrFees  Method for clearing 'summary' labels
  
 Variables:
Inputs
 oil, lube - bool
 radflsh, tranflsh
 inspect, muffreplace, tirerotate
 
 amtparts -  decimal = 0
 hrslabor - int = 0
Outputs
 totother - decimal
 amtparts - decimal
 tottax - decimal
 totfees - decimal
Temps
 totoilube - decimal
 totflush - decimal
 totmisc - decimal

 pseudo-code:
MAIN
 init vars
  
 calc tot charges
  totoillube = OilLubeChrgs(oil, lube)
  totflush = FlushChrgs(radflsh, tranflsh)
  totmisc = MiscChrgs(inspect, muffreplace, tirerotate)
  totother = OtherChrgs(amtparts, hrslabor)
  tottax = 0.06 * amtparts
  totfees = TotalChrgs(totoillube, totflush, totmisc, totother, tottax)
 display totals
  disp totother
  disp amtparts
  disp tottax
  disp totfees
 clear form
  ClrOilLube
  ClrFlushes
  ClrMisc
  ClrOther
  ClrFees 
 HALT

-----
method OilLubeChrgs(loil, llube)
ret: ltotoillube
  
*/


Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 
 

 

 

Copyright © MoDraves