USSR Naval Vessel
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Time to complete | Allow 4-6 hours continuous | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Program Download | USSRSHIP.Cbl is a model answer. Don't look at this until you have made your own attempt at the program. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example Output |
USSRSHIP.Rpt (The report generated from the Vessel Master File) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example Input |
UVMF.Dat (The unsorted USSR Vessel Master File) records) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Major Constructs | Sequential files, SORT with Input Procedure, Print Files, Pre-defined tables, Condition Names | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionThe unsorted USSR Vessel Master File (UVMF) contains details of all the
sea-going vessels of the SOVIET UNION. The following is the record description.
A program is required to produce a report detailing the major vessels (Vessels of tonnage 3,500 or greater and all submarines) in each of the following locations;
The report must be produced sequenced on ascending Location Code where Location code 1 is the Pacific, code 2 is the Atlantic, code 3 is the Mediterranean, code 4 is the Indian Ocean and code 5 is any Other Seas. Within each location the report must be sequenced on ascending Vessel Type. Each vessel detail line must show the Vessel Name, the Crew size, the Tonnage and the monthly running cost (Crew size * Cost per member). The cost per crew member is obtained from the following table where the values indicate the running cost in roubles for one month for one crew member;
Monthly Cost Table
The first detail line for each location must also show the Location Name (i.e. Pacific Ocean, Atlantic Ocean, Mediterranean Sea, Indian Ocean, Other Seas) and the first detail line for each Vessel Type must show the Vessel Function. The Vessel Function is obtained from the following table;
Vessel Function Table
ProcessingThe program will read the USSR Vessel Master File to produce a new file sorted on ascending Vessel Type within ascending Location Code and containing only submarines and vessels of tonnage 3,500 or greater. The program will then read this new sorted file and use it, and the Vessel Function and Monthly Cost tables, to produce the report.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Line2 |
To be printed at the top of the report only. No page breaks are
required so no page heading, page count or line count is required. |
| Line 5 | To be printed at the top of the report only. |
| Line 7 | This is a detail line and is to be printed
for each vessel in the sorted file. The Location Name must be suppressed after its first occurrence until a new Location is encountered. The Vessel Function must also be suppressed after its first occurrence until a new Vessel Type is encountered. The Tonnage field must be zero suppressed and be broken into thousands by inserting commas in the correct places. The Crew field must be zero suppressed and broken into thousands by commas. The Monthly Cost field must have floating Rouble signs (R), up to, but not including, the last digit. It must also be broken into thousands by inserting commas. |
Copyright Notice
This COBOL project specification is the copyright property of Michael Coughlan. You have permission to use this material for your own personal use but you may not reproduce it in any published work without written permission from the author.