Need your opinion:

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 21
Reputation: army88m2 is an unknown quantity at this point 
Solved Threads: 0
army88m2 army88m2 is offline Offline
Newbie Poster

Need your opinion:

 
0
  #1
Jul 25th, 2008
O.k. this is my first scripting class and I need someone's opinion on this code. I need to write a code for a modularized program that will:

1.) read each record from the inventory database

2.) print a price tag for each item in inventory

3.) count and print the total number of tags printed

4.)sum and print the total retail value of the inventory in the store

Here's the code I came up with. Please tell me if it is correct or not.



Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. start
  2. perform housekeeping ('This will declare variables perform housekeeping ) (with read)
  3. while not eof
  4. perform mainLoop (‘This will read each record from the database)
  5. perform calculateTotalretailvalue ( )
  6. endwhile
  7. perform finishup ( )
  8. stop
  9.  
  10. housekeeping ( )
  11. declare variables
  12.  
  13. invRecord
  14. char invDescription
  15. num invItemnumber
  16. num invQuantity
  17. num invRetailprice
  18. num invTotalretailvalue
  19. num invTotaltags
  20.  
  21. char mainHeading = "INVENTORY REPORT"
  22. char columnHead1 =
  23. "ITEM RETAIL PRICE QUANTITY DESCRIPTION"
  24.  
  25. char columnHead2 =
  26. "TOTAL RETAIL VALUE TOTAL TAGS ITEM NUMBER"
  27. num totalRetailvalue
  28. open files
  29. INVENTORY , Printer
  30. print mainHeading
  31. print columnHead1
  32. print columnHead2
  33. read invRecord
  34. return
  35.  
  36. mainloop ( )
  37. Read the first record
  38. While not eof
  39. Print fldItemnumber , fldDescription , fldQuantityonhand , fldRetailPrice
  40. ItemCount = ItemCount +1
  41. Totalretailvalue = (fldQuantity * fldRetailprice )
  42. endwhile
  43. Read next record
  44. Loop
  45.  
  46. Print “Retail price : “ & ItemCount
  47. Print “Value of Inventory = “ & Totalretailvalue
  48. return
  49.  
  50. calculateTotalretailvalue ( )
  51. Totalretailvalue = (fldQuantity * fldRetailprice )
  52. return
  53.  
  54. printTotalretailvalue ( )
  55. print Totalretailvalue
  56. return
  57. finishup ( )
  58. close files
  59. INVENTORY , Printer
  60. return
Last edited by Tekmaven; Jul 25th, 2008 at 2:07 pm. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 51
Reputation: dmf1978 is an unknown quantity at this point 
Solved Threads: 7
dmf1978's Avatar
dmf1978 dmf1978 is offline Offline
Junior Poster in Training

Re: Need your opinion:

 
0
  #2
Jul 25th, 2008
Sorry,
But it is not VB code.
And please, use the [ CODE][/CODE ] tags.
Last edited by dmf1978; Jul 25th, 2008 at 1:51 pm.
-- Martín
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 4
Reputation: chid_ is an unknown quantity at this point 
Solved Threads: 1
chid_ chid_ is offline Offline
Newbie Poster

Re: Need your opinion:

 
0
  #3
Jul 26th, 2008
Isn't it actually
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC