Information Technology > SOLUTIONS MANUAL > Northern Virginia Community College Chapter 6 - Homework Solutions ITP 100 (All)
8 Design a program that will produce the same report as in Problem 7, but, in addition, print at the end of the parts listing a count of all the records whose part number falls between AA3000 and AA39 ... 99, as well as a count of all records whose part numbers begin with the value ‘AA’. A Defining diagram Input Processing Output inventory records • record_code • part_no • part_desc • inventory_balance Read inventory record Validate inventory record Select inventory records Print selected records Calculate total_AA_records Calculate total_selected_records Print totals selected inventory records • record_code • part_no • part_desc • inventory_balance total_AA_records total_selected_records B Control structures required 1 A DOWHILE loop to control the repetition 2 IF statements to validate the inventory fields 3 An IF statement to select required records 4 Accumulators for total_selected_records, total_AA_records C Solution algorithm Process_inventory_records Set total_selected_records, total_AA_records to zero Read inventory record DOWHILE more records Set valid_record to true IF record_code NOT = 11 THEN valid_record = false ENDIF assign 1st 2 characters of part_no to alpha_part_no assign last 4 characters of part_no to numeric_part_no IF alpha_part_no NOT alphabetic THEN valid_record = false ENDIF IF numeric_part_no NOT numeric THEN valid_record = false ENDIF IF valid_record THEN IF (part_no >= AA3000 AND part_no <= AA3999) THEN Print inventory record add 1 to total_selected_records ENDIF [Show More]
Last updated: 2 years ago
Preview 1 out of 3 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Apr 08, 2021
Number of pages
3
Written in
All
This document has been written for:
Uploaded
Apr 08, 2021
Downloads
0
Views
116
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·