•
•
•
•
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
![]() |
•
•
Join Date: Jul 2008
Posts: 16
Reputation:
Rep Power: 1
Solved Threads: 0
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.
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Opinion on Software Theft (Techies' Lounge)
- Your Valuable Opinion Needed - Thank You (C++)
- Final yr project an opinion needed on "dynamic web pg creator" (Computer Science and Software Design)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Need to separate 16 bit binary to 4bit and 12 bit binary values
- Next Thread: editting existing txt file data


Linear Mode