Draw a write the pseudocode for a computer program which will process an invento
ID: 3572854 • Letter: D
Question
Draw a write the pseudocode for a computer program which
will process an inventory control file containing an unknown
number of records. Print (or display) the inventory record of the
item which must be reordered.
Each record in the inventory file contains the following
data fields with the names in parentheses:
(1) Item Name (ITEM NAME) (2) Item Number (ITEM NUMBER) (3) Selling Price (SP) (4) Item Cost (C) (5) Quantity Sold This Month (QSM) (6) Quantity Sold This Year (QSY) (7) Quantity Currently On Hand (QOH) (8) Total Yearly Quantity Requirements (9) Ordering Set-Up Cost per Order Placed (S) (10) Inventory Carrying Cost (R) (I) Items to be computed:
(1) Cost of Items Sold This Month
(CSM)
CSM = QSM
(2) Cost of Items Sold This Year
(CSY)
CSY =
(3) Cost of Items On Hand
(COH)
COH = QOH *
(4) Total Cost of Items on Hand
(TCOH) TCOH = TCOH * C
QSY * C
C
+ COH (5) Year-To-Date Profit = (Selling Price - Item Cost) * QSY
YTD-Profit = (SP - C) * QSY (6) Total-Profit = Total-Profit + YTD-Profit 9
(7) NOTE: Economic Ordering Quantity (EOQ)
EOQ = SQUARE ROOT (R*S/C*I) Do NOT create a module for each calculation !
Modules needed: INVENTORY, HSK, PROCESS, CALCS, READ, EOJ OTHER
REQUIREMENTS:
If the Quantity On Hand (QOH) is less than the Economic
Ordering Quantity (EOQ), print this inventory record
since this is the item which must be reordered.
Otherwise, do NOT print the record (NULL).
In the End-Of-Job (EOJ) module, print both TCOH and
TOTAL-PROFIT and close the files.
The number of records in the inventory file is unknown,
so be sure to check for an end-of file (EOF) condition.
Your modular flowchart and pseudocode should represent a
complete computer solution and show all the actions
necessary
to
make
the
design
work
including
initialization (housekeeping), main processing, record
reading, calculations, total accumulation, end-of-file
checking, and end-of-job (termination).
Be sure to have a separate module for the calculations.
Be sure to open and close the files (inventory file and
print file).
Be sure to set the total accumulators to zero in the
housekeeping module. (Total-Profit and TCOH)
Use a modular approach.
Explanation / Answer
EOJ MODULE
//this module check whether we have reached end of job
if EOF Then
print TCOH
print TOTAL PROFIT
close the file
return true
else
return false
CALCS MODULE
//this module calculates and maintains important variables
Calculate CSM
Calculate CSY
Calculate COH
Calculate TCOH
Calculate ETD Profit
Calculate TOTAL PROFIT
Calculate EOQ
PROCESS MODULE
Call CALCS MODULE
READ MODULE
//this module reads every line and checks for EOF
Call EOJ Module
if true then
input the lines
call PROCESS MODULE
end if
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.