Assignment #6 - Sequential Files and Decision Logic This assignment relates to the following Course Learning Requirements:
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 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:
- Launch Visual COBOL for Eclipse
- 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:
- For each store, the salary expenses for Management, Salespersons, Administration, and Custodial staff.
- 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.
- 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.
- Creat a new COBOL program for this assignment in your Assignment #6 project.
- Complete the Environment Division and Data Division to reference our input data file and hold storage for the 59-character data record.
- 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.
- 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
- 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".
- 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.
- Remember to close the file before ending the program.
Exercise #4 - Output the Salary Expense Report
- Mak the necessary additions to the ENVIRONMENT and DATA Divisions to include the Salary Expense file and output record. Name the file "SalaryExpense.rpt".
- 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.
- 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 |
Microeconomics
ISBN: 978-0321866349
14th canadian Edition
Authors: Christopher T.S. Ragan, Richard G Lipsey