Question: Assignment #6 - Sequential Files and Decision Logic This assignment relates to the following Course Learning Requirements: CLR 1: Write COBOL program code and simple

Assignment #6 - Sequential Files and Decision Logic

This assignment relates to the following Course Learning Requirements:

CLR 1: Write COBOL program code and simple JCL, using prescribed design documents and top-down structured programming techniques.

CLR 3: Identify appropriate strategies for solving a problem.

CLR 4: Produce document(s) that represent the logic applied to data, given program specifications.

CLR 5: Produce tested COBOL code that executes correctly and consistently.

Objective of this Assignment:

The objective of this assignment is to process a sequential data file in order to output a summary on screen and output filtered data to another sequential file.

Pre-Assignment Instructions:

  1. Launch Visual COBOL for Eclipse
  2. Creat a new COBOL Project called Assignment #6

Assignment Tasks:

Context: The Algonquin Furniture Company operates 3 stores in the Ottawa area. Each week, the payroll is processed at the head office for all 3 stores. On a weekly basis, the directors require the following information:

  1. For each store, the salary expenses for Management, Salespersons, Administration, and Custodial staff.
  2. For each store, the list of sales people who had over $100,000 in sales in that week. The list of high performing salespeople will receive gift cards to restaurants or tickets to sporting events.

SYSTEM DIAGRAM

The full program can be broken up into 4 exercises.

Exercise #1 - Open and read the records sequentially until end-of-file.

  1. Locate the file "Assignment#6_WeeklySalaryDataFile.dat" that was bundled with this assignment. Copy the file to C:\DataFiles. We will refer to this location in our COBOL program ASSIGN clauses.

  1. Creat a new COBOL program for this assignment in your Assignment #6 project.

  1. Complete the Environment Division and Data Division to reference our input data file and hold storage for the 59-character data record.

  1. In the Procedure Division, begin by opening the file and read each record until end of file. Close the file.

Tip: Run the program the first time while debugging. Press F11 to start debugging and F5 to step through each line of code.

Exercise #2 - Prepare data hierarchy for the input record.

  1. Creat a Data Hierarchy for the input record as follows:

Columns 1 - 4 : Employee ID

Column 5 : Job Code (M = Manager, S = Salesperson, A = Administration, C = Custodial Staff)

Columns 6 - 19 : Employee Last Name

Columns 20 - 33: Employee FirstName

Columns 34 - 41: Employee Start Date

Columns 42 - 45: Store Number

Columns 46 - 51: Weekly Salary

Columns 52 - 59: Sales Amount (Salespeople only)

Exercise #3 - Output Employee Sales Recognition Report

  1. Make the necessary additions to the ENVIRONMENT and DATA Divisions to include the Employee Recognition (Gift) file and output record.Name the file "SalespersonRecognition.rpt".

  1. The output for this file should be as follows.(Replace 2020-02-08 with the current date.):

Employee recognition for the week ending: 2020-02-08

----------------------------------------------------

Last Name First Name Store #

----------------------------------------------------

CAMERON STANLEY 0003

ELDOUR JOHNATHAN 0002

...

Hint: Write the report header lines immediately after opening the file. While reading each input record, check to see if the employee Job Code = 'S' and Sales Amount > $100,000.00. If you have matched a high performance sales person, move the corresponding data items to the report record and write the record.

  1. Remember to close the file before ending the program.

Exercise #4 - Output the Salary Expense Report

  1. Mak the necessary additions to the ENVIRONMENT and DATA Divisions to include the Salary Expense file and output record. Name the file "SalaryExpense.rpt".

  1. While reading each input record, add the salary amount to an accumulator data item. You can create individual Working Storage data items to hold each total. For example:

  • Store1_M_Total
  • Store1_S_Total
  • Store1_A_Total
  • Store1_C_Total
  • Store2_M_Total
  • Store2_S_Total
  • Store2_A_Total
  • Store2_C_Total
  • Store3_M_Total
  • Store3_S_Total
  • Store3_A_Total
  • Store3_C_Total

Hint: Use the Add ... to ... statement to add to the totals.

  1. The report should follow this structure (Totals are arbitrary.Replace 2020-02-08 with the current date.):

Salary expense for the week ending: 2020-02-08

STORE #1

Management: 3148.00

Sales : 8148.50

Admin : 800.00

Custodial : 1450.50

STORE #2

Management: 2978.00

Sales : 6684.50

Admin : 800.00

Custodial : 1450.50

STORE #3

Management: 3678.00

Sales : 7458.50

Admin : 800.00

Custodial : 1450.50

Upload your code and two output files to Brightspace.

Assignment Grading Rubric (3%)

Exercise #1 Read file sequentially /10
Exercise #2 Data Hierarchy /5
Exercise #3 Environment / Data Division /5
Procedural Logic /5
Output /5
Exercise #4 Environment / Data Division /5
Procedural Logic /5
Output /5
Total Points 45

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!