Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description Create a new program called A2-ItemList. This program will read records from a data file named A2.dat; perform calculations and formatting based on the

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Description Create a new program called "A2-ItemList". This program will read records from a data file named "A2.dat"; perform calculations and formatting based on the values of fields in the data records and write a formatted report output to a file named "A2-ItemList.out". The format of the input and output files are provided in this document. To help in your development efforts, you should consider writing the program in the following stages. 1. Write the program to output the Item Number, Product Class, Description, Quantity, Price per Unit for each input record to prove that you are reading the input data file properly. This ensures you are able to read the input data correctly and output the data accurately with the headings properly aligned over the data with blank lines providing required spacing. 2. Add the simple calculations for Extended Price and Net Price to comblete the detail line for each record. Outbut this data to confirm vou 2. Add the simple calculations for Extended Price and Net Price to complete the detail line for each record. Output this data to confirm you have done these calculations correctly. Note: Use zero for the Discount Amount at this stage. 3. Determine the discount percentage or discount amount to use and add the calculation for Discount Amount. Adjust the Net Price calculation to use the Discount Amount and add the Discount Amount to the output to confirm you have done these calculations correctly. Mainframe Development 1 - Assignment 2 MAFD4202 4. Determine the transportation charge percentage or transportation charge amount to use and add the calculation for Transportation Charge. Output this data to confirm you have done these calculations correctly. 5. Add variables for the totals for Extended Price. Net Price. and 5. Add variables for the totals for Extended Price, Net Price, and Transportation Charge. Be sure to initialize these to zero. After each input record is output add the detail amounts for Extended Price, Net Price, and Transportation Charge to their respective totals. Output the totals for Extended Price, Net Price, and Transportation Charge properly aligned with the detail columns as shown to confirm you have done these calculations correctly. 6. Add variables for the count of the number of items, the number of items with a discount and the percentage of items without a discount. Be sure to initialize these variables to zero. After all the input records are output then calculate the percentage of items without a discount. Output the percentage of items without a discount to confirm you have done these calculations correctly. Download the required data file (A2.dat) from DC Connect. Each data record is 27 characters long with the following format (pay close attention to the price per unit, since the decimal is not stored in the data file). The following is intended to provide the column layout of the file: For this assignment you: - MUST use the appropriate arithmetic verbs (ADD, MULTIPLY, etc.) - MUST NOT use the COMPUTE verb. 1) General Formatting: Print out the detail line for each item double spaced (see sample): a) The headings and data must be output according to the sample format provided with everything aligned correctly in columns. b) The column titles (data field names) are Item Number, Item Description, Quantity, Per Unit Price, Extended Price (Quantity * Per Unit Price), Discount Amount, Net Price, Product Class, Transportation \% (print in percent form, e.g. 11.5% ), and Transportation Charge. c) OUTPUT NUMERIC EDITING for the detail line. Use Z, 9 and ',' (comma). Leave 1 digit to the left of the decimal point (i.e. 0.09) for small values. Accumulate and print (WITHOUT TITLES) aligned correctly under their respective columns, a) the totals of i) the extended prices, ii) net prices and iii) transportation charges. b) Use floating $ and ',' (comma) editing. c) Leave 2 blank lines between the last data line and this line. d) Use 01 in working-storage for this total line. 6) Overall Discount Analysis: a) Calculate the percentage of items that did not received a discount, correct to 1 decimal place. b) Print the result on a separate line (after \#5) with the label "ITEMS WITHOUT DISCOUNT = " c) Use 01 level in working-storage for this total line. YOUR NAME HERE, A2 2) Discount Calculations: A discount of 5% is allowed for: a) Product Class A - only if the Extended Price is greater than $100 b) Product Class F - only if the Extended Price is greater than $50 c) Product Class B - only if the Quantity is greater than 5 For Product Classes without a discount the DISCOUNT AMOUNT field is to be printed as 0.00. 3) Transportation Charge Calculations: a) For Product Class A - it is 12.5% of the Extended Price. b) For Product Class D - it is 8.5% of the Extended Price. c) For Product Class F - it is 4.5% of the Extended Price. d) For all other classes, if the quantity is 100 or less, the Transportation Charge is 6.5% of the Extended Price, otherwise it's a flat $45.00. e) For the flat Transportation Charge print the transportation \% as 0.0%. In all cases, DO NOT add the transportation charge to the net price. a) Print your name \& A2 at the top as shown on the sample output. Use 01 in Working-Storage for these headings. b) Print the column headings shown on the attached. Use 01 in working-storage for this heading. c) Leave 2 blank lines before and after the column heading lines. Mainframe Development 1 - Assignment 2 MAFD4202 5) Summary Line: Accumulate and print (WITHOUT TITLES) aligned correctly under their respective columns, a) the totals of i) the extended prices, ii) net prices and iii) transportation charges. h) Use floatina $ and ' (comma) editina. Description Create a new program called "A2-ItemList". This program will read records from a data file named "A2.dat"; perform calculations and formatting based on the values of fields in the data records and write a formatted report output to a file named "A2-ItemList.out". The format of the input and output files are provided in this document. To help in your development efforts, you should consider writing the program in the following stages. 1. Write the program to output the Item Number, Product Class, Description, Quantity, Price per Unit for each input record to prove that you are reading the input data file properly. This ensures you are able to read the input data correctly and output the data accurately with the headings properly aligned over the data with blank lines providing required spacing. 2. Add the simple calculations for Extended Price and Net Price to comblete the detail line for each record. Outbut this data to confirm vou 2. Add the simple calculations for Extended Price and Net Price to complete the detail line for each record. Output this data to confirm you have done these calculations correctly. Note: Use zero for the Discount Amount at this stage. 3. Determine the discount percentage or discount amount to use and add the calculation for Discount Amount. Adjust the Net Price calculation to use the Discount Amount and add the Discount Amount to the output to confirm you have done these calculations correctly. Mainframe Development 1 - Assignment 2 MAFD4202 4. Determine the transportation charge percentage or transportation charge amount to use and add the calculation for Transportation Charge. Output this data to confirm you have done these calculations correctly. 5. Add variables for the totals for Extended Price. Net Price. and 5. Add variables for the totals for Extended Price, Net Price, and Transportation Charge. Be sure to initialize these to zero. After each input record is output add the detail amounts for Extended Price, Net Price, and Transportation Charge to their respective totals. Output the totals for Extended Price, Net Price, and Transportation Charge properly aligned with the detail columns as shown to confirm you have done these calculations correctly. 6. Add variables for the count of the number of items, the number of items with a discount and the percentage of items without a discount. Be sure to initialize these variables to zero. After all the input records are output then calculate the percentage of items without a discount. Output the percentage of items without a discount to confirm you have done these calculations correctly. Download the required data file (A2.dat) from DC Connect. Each data record is 27 characters long with the following format (pay close attention to the price per unit, since the decimal is not stored in the data file). The following is intended to provide the column layout of the file: For this assignment you: - MUST use the appropriate arithmetic verbs (ADD, MULTIPLY, etc.) - MUST NOT use the COMPUTE verb. 1) General Formatting: Print out the detail line for each item double spaced (see sample): a) The headings and data must be output according to the sample format provided with everything aligned correctly in columns. b) The column titles (data field names) are Item Number, Item Description, Quantity, Per Unit Price, Extended Price (Quantity * Per Unit Price), Discount Amount, Net Price, Product Class, Transportation \% (print in percent form, e.g. 11.5% ), and Transportation Charge. c) OUTPUT NUMERIC EDITING for the detail line. Use Z, 9 and ',' (comma). Leave 1 digit to the left of the decimal point (i.e. 0.09) for small values. Accumulate and print (WITHOUT TITLES) aligned correctly under their respective columns, a) the totals of i) the extended prices, ii) net prices and iii) transportation charges. b) Use floating $ and ',' (comma) editing. c) Leave 2 blank lines between the last data line and this line. d) Use 01 in working-storage for this total line. 6) Overall Discount Analysis: a) Calculate the percentage of items that did not received a discount, correct to 1 decimal place. b) Print the result on a separate line (after \#5) with the label "ITEMS WITHOUT DISCOUNT = " c) Use 01 level in working-storage for this total line. YOUR NAME HERE, A2 2) Discount Calculations: A discount of 5% is allowed for: a) Product Class A - only if the Extended Price is greater than $100 b) Product Class F - only if the Extended Price is greater than $50 c) Product Class B - only if the Quantity is greater than 5 For Product Classes without a discount the DISCOUNT AMOUNT field is to be printed as 0.00. 3) Transportation Charge Calculations: a) For Product Class A - it is 12.5% of the Extended Price. b) For Product Class D - it is 8.5% of the Extended Price. c) For Product Class F - it is 4.5% of the Extended Price. d) For all other classes, if the quantity is 100 or less, the Transportation Charge is 6.5% of the Extended Price, otherwise it's a flat $45.00. e) For the flat Transportation Charge print the transportation \% as 0.0%. In all cases, DO NOT add the transportation charge to the net price. a) Print your name \& A2 at the top as shown on the sample output. Use 01 in Working-Storage for these headings. b) Print the column headings shown on the attached. Use 01 in working-storage for this heading. c) Leave 2 blank lines before and after the column heading lines. Mainframe Development 1 - Assignment 2 MAFD4202 5) Summary Line: Accumulate and print (WITHOUT TITLES) aligned correctly under their respective columns, a) the totals of i) the extended prices, ii) net prices and iii) transportation charges. h) Use floatina $ and ' (comma) editina

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the APPROACHES TO HRM?

Answered: 1 week ago