943,685 Members | Top Members by Rank

Ad:
Jul 25th, 2008
0

Need your opinion:

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
army88m2 is offline Offline
21 posts
since Jul 2008
Jul 25th, 2008
0

Re: Need your opinion:

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.
Reputation Points: 18
Solved Threads: 7
Junior Poster in Training
dmf1978 is offline Offline
51 posts
since Aug 2006
Jul 26th, 2008
0

Re: Need your opinion:

Isn't it actually
Reputation Points: 10
Solved Threads: 1
Newbie Poster
chid_ is offline Offline
4 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Need to separate 16 bit binary to 4bit and 12 bit binary values
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: editting existing txt file data





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC