User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,100 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,289 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 188 | Replies: 2
Reply
Join Date: Jul 2008
Posts: 16
Reputation: army88m2 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
army88m2 army88m2 is offline Offline
Newbie Poster

Need your opinion:

  #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.



start
   perform housekeeping ('This will declare variables perform housekeeping )	(with read)
     while not eof
     perform mainLoop (‘This will read each record from the database)
perform calculateTotalretailvalue ( )
endwhile 
perform finishup ( )
stop

housekeeping ( )
       declare variables
           
              invRecord
                         char	invDescription
                         num	invItemnumber
                         num	invQuantity
                         num	invRetailprice
                         num	invTotalretailvalue
                         num	invTotaltags

             char mainHeading = "INVENTORY REPORT"	
             char columnHead1 =
               "ITEM	RETAIL PRICE	QUANTITY		DESCRIPTION"

             char columnHead2 =
               "TOTAL RETAIL VALUE		TOTAL TAGS	ITEM NUMBER"
             num totalRetailvalue
open files
       INVENTORY , Printer
print mainHeading
print columnHead1
print columnHead2
read invRecord
return

mainloop ( )
Read the first record
While not eof
       Print fldItemnumber , fldDescription , fldQuantityonhand , fldRetailPrice
       ItemCount = ItemCount +1
       Totalretailvalue = (fldQuantity * fldRetailprice )
endwhile
Read next record
Loop

Print “Retail price : “ & ItemCount
Print “Value of Inventory = “ & Totalretailvalue
return

calculateTotalretailvalue ( )
     Totalretailvalue = (fldQuantity * fldRetailprice )
return

printTotalretailvalue ( )
     print Totalretailvalue
return
finishup ( )
   close files
       INVENTORY , Printer
return
Last edited by Tekmaven : Jul 25th, 2008 at 1:07 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Location: Argentina
Posts: 51
Reputation: dmf1978 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 7
dmf1978's Avatar
dmf1978 dmf1978 is offline Offline
Junior Poster in Training

Re: Need your opinion:

  #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 12:51 pm.
-- Martín
Reply With Quote  
Join Date: Jul 2008
Posts: 4
Reputation: chid_ is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
chid_ chid_ is offline Offline
Newbie Poster

Re: Need your opinion:

  #3  
Jul 26th, 2008
Isn't it actually
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 5:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC