New Jersey Institute of Technology (NJIT)
Computer and Information Science Department (CIS)
CIS365-001: File Structures and Management, Fall 1999
Professor: Michael Bieber

Homework 2a: Input File - Version 2

Due

Monday, September 20, 1999 at the start of class
(but don't skip class to finish this assignment!)

Goal

To write your own COBOL program, and to prepare for future homework assignments

Reading

Start reading the Stern & Stern text. You should have read the first four chapters by Monday September 27th.

Assignment

Write a COBOL program that will create a master file for the "Hooked on the Book Nook" bookstore. The program will ask the user to input data from the keyboard. The master file contains all books the store offers. It has the following record structure:

 

01 books.

05 isbn PIC X(13).

05 title PIC X(30).

05 author PIC X(20).

05 year PIC 9999.

05 category PIC X(6).

05 price PIC 999V99.

 

Input the following records into your master data file using your program:

Book ID (ISBN)

Title

Author

Year

Type

Price

2-222-22222-2

Information Systems

Alter, Steven

1992

Bus

049.95

3-333-33333-3

The Fellowship of the Ring

Tolkien, J. R. R.

1965

Fan

005.95

4-444-44444-4

Gateway

Pohl, Frederick

1977

SciFi

005.95

5-555-55555-5

Millennium

Varley, John

1988

SciFi

006.95

6-666-66666-6

Beyond the Safe Zones

Silverberg, Robert

1986

SciFi

006.95

7-777-77777-7

Taxes for Dummies

Tyson, Eric

1995

Tax

013.49

 

Check your master file using the Fujitsu file utilities to ensure all records have been entered correctly. (The "Installing, Compiling, ..." handout describes this. Remember that you must tell the file utilities the record length (and add 2 to this).

 

What to Turn In

Turn in your program listings and a printout of your data file. Use a regular word processor to open and print your data file. Because it may print the entire file out without line breaks, mark with a pen or pencil where each record starts.

Staple these and put your name on each page.


last update: 9/16/99

This page: http://www.cis.njit.edu/~bieber/CIS365F99/hw2a.html