Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Modules Help!!


  • Please log in to reply
1 reply to this topic

#1 Rjog


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 11 May 2008 - 10:19 AM

hey so im in a introduction to scripting class and im totally lost any help would be great just to show me an example of what this would look like and any tricks heres the problem

Apply your knowledge of modules and database file processing.

Part A. A pet store maintains an inventory database of all of the items in the shop. The shop manager wants a report that details the profit value of each inventory item on hand. The database contains the following fields:

File name: Inventory
Stock Number
Wholesale price
Retail Price

Here are a few sample records from the inventory database:
Fields --> Stock Number Description Wholesale price Retail Price
Record 1 --> 1234 "Dog Bone" $5 $10
Record 2 --> 3451 "Gold Fish" $2 $4
Record 3 --> 5643 "Fish Food" $2.50 $5
Write the pseudocode for a modularized program that will:

* Read each record from the inventory database
* Compute the profit for each record
* Print the record item's description, retail price and profit amount

Be sure to:

* Include a comment at the beginning of each module that describes the purpose of that module. A line containing a comment should begin with a single-quote (').
* Choose descriptive module and variable names
* Properly format your pseudocode (indentation)
* Use a structured loop to read the records

Edited by Rjog, 11 May 2008 - 10:22 AM.

  • 0

#2 Xav


    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 11 May 2008 - 12:28 PM

Um - so why would you need a module?
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

Also tagged with one or more of these keywords: pseudocode

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download