Cobol assignment

Assignment Help COBOL Programming
Reference no: EM13974571

-this a Cobol HW.
- I post examples on the bottom of this paper.
-at the end I need the program in .cbl , the output screen and the print chart.

- the instructor said that
* on the program avoid 77 use 01
* name of micro focus extension, input file, output file must be in .txt
* on the program instead of 01 PRINT-AREA PIC X(132). use 01 PRINT-AREA PIC X(70).
* needs print shout in the header report.


CSDP241 Spring, 2016 Program 01

For this program you will use a file INFILE (listed here in numbers) that has information about students and their grades on 4 exams. The input file is shown below:

070543242 100078098084
091020222 090085098000
075655343 022067076057
513467845 076083082092

The numbers on the left are Student Numbers. The interpretation of the numbers on the right are: the student 070543242 has grade 100 on exam 1, grade 078 on exam 2, grade 098 on exam 3 and grade 084 on exam 4.

Your job is to display a report of the above information that includes overall averages for each student for exams 1 through 4, and class averages (assuming the class has 4 students) for each exam, and the overall class average for all exams.



The actual output of the program is shown below:

CLASS AVERAGE REPORT


STUDENT G R A D E S
NUMBER EXAM 1 EXAM 2 EXAM 3 EXAM 4 AVERAGE

070543242 100 078 098 084 0900
091020222 090 085 098 000 0683
075655343 022 067 076 057 0555
513467845 076 083 082 092 0833


AVERAGES 0720 0783 0885 0583 0743

Pass in your completed program (.cbl file only)


Sample
Example 1.

IDENTIFICATION DIVISION.
*
PROGRAM-ID. CALC1000.
*
ENVIRONMENT DIVISION.
*
INPUT-OUTPUT SECTION.
*
DATA DIVISION.
*
FILE SECTION.
*
WORKING-STORAGE SECTION.
*
77 END-OF-SESSION-SWITCH PIC X VALUE "N".
77 SALES-AMOUNT PIC 9(5)V99.
77 SALES-TAX PIC Z,ZZZ.99.
*
PROCEDURE DIVISION.
*
000-CALCULATE-SALES-TAX.
*
PERFORM 100-CALCULATE-ONE-SALES-TAX
UNTIL END-OF-SESSION-SWITCH = "Y".
DISPLAY "END OF SESSION.".
STOP RUN.
*
100-CALCULATE-ONE-SALES-TAX.
*
DISPLAY "-----------------------------------------------".
DISPLAY "TO END PROGRAM, ENTER 0.".
DISPLAY "TO CALCULATE SALES TAX, ENTER THE SALES AMOUNT.".
ACCEPT SALES-AMOUNT.
IF SALES-AMOUNT = ZERO
MOVE "Y" TO END-OF-SESSION-SWITCH
ELSE
COMPUTE SALES-TAX ROUNDED =
SALES-AMOUNT * .0785
DISPLAY "SALES TAX = " SALES-TAX.
Example 2.
IDENTIFICATION DIVISION.

PROGRAM-ID. RPT1000.

ENVIRONMENT DIVISION.

INPUT-OUTPUT SECTION.

FILE-CONTROL.

SELECT CUSTMAST ASSIGN TO "CUSTMAST.txt"
ORGANIZATION IS LINE SEQUENTIAL.
SELECT SALESRPT ASSIGN TO "SALESRPT.txt".

DATA DIVISION.

FILE SECTION.

FD CUSTMAST.

01 CUSTOMER-MASTER-RECORD.
05 CM-BRANCH-NUMBER PIC 9(2).
05 CM-SALESREP-NUMBER PIC 9(2).
05 CM-CUSTOMER-NUMBER PIC 9(5).
05 CM-CUSTOMER-NAME PIC X(20).
05 CM-SALES-THIS-YTD PIC S9(5)V9(2).
05 CM-SALES-LAST-YTD PIC S9(5)V9(2).

FD SALESRPT.

01 PRINT-AREA PIC X(132).

WORKING-STORAGE SECTION.

01 SWITCHES.
05 CUSTMAST-EOF-SWITCH PIC X VALUE "N".

01 PRINT-FIELDS.
05 PAGE-COUNT PIC S9(3) VALUE ZERO.
05 LINES-ON-PAGE PIC S9(3) VALUE +55.
05 LINE-COUNT PIC S9(3) VALUE +99.
05 SPACE-CONTROL PIC S9.

01 TOTAL-FIELDS.
05 GRAND-TOTAL-THIS-YTD PIC S9(7)V99 VALUE ZERO.
05 GRAND-TOTAL-LAST-YTD PIC S9(7)V99 VALUE ZERO.

01 CURRENT-DATE-AND-TIME.
05 CD-YEAR PIC 9999.
05 CD-MONTH PIC 99.
05 CD-DAY PIC 99.
05 CD-HOURS PIC 99.
05 CD-MINUTES PIC 99.
05 FILLER PIC X(9).

01 HEADING-LINE-1.
05 FILLER PIC X(7) VALUE "DATE: ".
05 HL1-MONTH PIC 9(2).
05 FILLER PIC X(1) VALUE "/".
05 HL1-DAY PIC 9(2).
05 FILLER PIC X(1) VALUE "/".
05 HL1-YEAR PIC 9(4).
05 FILLER PIC X(11) VALUE SPACE.
05 FILLER PIC X(20) VALUE "YEAR-TO-DATE SALES R".
05 FILLER PIC X(20) VALUE "EPORT ".
05 FILLER PIC X(8) VALUE " PAGE: ".
05 Hl1-PAGE-NUMBER PIC ZZZ9.
05 FILLER PIC X(52) VALUE SPACE.

01 HEADING-LINE-2.
05 FILLER PIC X(7) VALUE "TIME: ".
05 HL2-HOURS PIC 9(2).
05 FILLER PIC X(1) VALUE ":".
05 HL2-MINUTES PIC 9(2).
05 FILLER PIC X(58) VALUE SPACE.
05 FILLER PIC X(10) VALUE "RPT1000".
05 FILLER PIC X(52) VALUE SPACE.

01 HEADING-LINE-3.
05 FILLER PIC X(20) VALUE "CUST ".
05 FILLER PIC X(20) VALUE " SALES ".
05 FILLER PIC X(20) VALUE " SALES ".
05 FILLER PIC X(72) VALUE SPACE.

01 HEADING-LINE-4.
05 FILLER PIC X(20) VALUE "NUM CUSTOMER NAME".
05 FILLER PIC X(20) VALUE " THIS YTD ".
05 FILLER PIC X(20) VALUE " LAST YTD ".
05 FILLER PIC X(72) VALUE SPACE.

01 CUSTOMER-LINE.
05 CL-CUSTOMER-NUMBER PIC 9(5).
05 FILLER PIC X(2) VALUE SPACE.
05 CL-CUSTOMER-NAME PIC X(20).
05 FILLER PIC X(3) VALUE SPACE.
05 CL-SALES-THIS-YTD PIC ZZ,ZZ9.99-.
05 FILLER PIC X(4) VALUE SPACE.
05 CL-SALES-LAST-YTD PIC ZZ,ZZ9.99-.
05 FILLER PIC X(78) VALUE SPACE.

01 GRAND-TOTAL-LINE.
05 FILLER PIC X(27) VALUE SPACE.
05 GTL-SALES-THIS-YTD PIC Z,ZZZ,ZZ9.99-.
05 FILLER PIC X(1) VALUE SPACE.
05 GTL-SALES-LAST-YTD PIC Z,ZZZ,ZZ9.99-.
05 FILLER PIC X(78) VALUE SPACE.

PROCEDURE DIVISION.

000-PREPARE-SALES-REPORT.

OPEN INPUT CUSTMAST
OUTPUT SALESRPT.
PERFORM 100-FORMAT-REPORT-HEADING.
PERFORM 200-PREPARE-SALES-LINES
UNTIL CUSTMAST-EOF-SWITCH = "Y".
PERFORM 300-PRINT-GRAND-TOTALS.
CLOSE CUSTMAST
SALESRPT.
STOP RUN.

100-FORMAT-REPORT-HEADING.

MOVE FUNCTION CURRENT-DATE TO CURRENT-DATE-AND-TIME.
MOVE CD-MONTH TO HL1-MONTH.
MOVE CD-DAY TO HL1-DAY.
MOVE CD-YEAR TO HL1-YEAR.
MOVE CD-HOURS TO HL2-HOURS.
MOVE CD-MINUTES TO HL2-MINUTES.

200-PREPARE-SALES-LINES.

PERFORM 210-READ-CUSTOMER-RECORD.
IF CUSTMAST-EOF-SWITCH = "N"
PERFORM 220-PRINT-CUSTOMER-LINE.

210-READ-CUSTOMER-RECORD.

READ CUSTMAST
AT END
MOVE "Y" TO CUSTMAST-EOF-SWITCH.

220-PRINT-CUSTOMER-LINE.

IF LINE-COUNT >= LINES-ON-PAGE
PERFORM 230-PRINT-HEADING-LINES.
MOVE CM-CUSTOMER-NUMBER TO CL-CUSTOMER-NUMBER.
MOVE CM-CUSTOMER-NAME TO CL-CUSTOMER-NAME.
MOVE CM-SALES-THIS-YTD TO CL-SALES-THIS-YTD.
MOVE CM-SALES-LAST-YTD TO CL-SALES-LAST-YTD.
MOVE CUSTOMER-LINE TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING SPACE-CONTROL LINES.
ADD 1 TO LINE-COUNT.
ADD CM-SALES-THIS-YTD TO GRAND-TOTAL-THIS-YTD.
ADD CM-SALES-LAST-YTD TO GRAND-TOTAL-LAST-YTD.
MOVE 1 TO SPACE-CONTROL.

230-PRINT-HEADING-LINES.

ADD 1 TO PAGE-COUNT.
MOVE PAGE-COUNT TO HL1-PAGE-NUMBER.
MOVE HEADING-LINE-1 TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING PAGE.
MOVE HEADING-LINE-2 TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING 1 LINES.
MOVE HEADING-LINE-3 TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING 2 LINES.
MOVE HEADING-LINE-4 TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING 1 LINES.
MOVE ZERO TO LINE-COUNT.
MOVE 2 TO SPACE-CONTROL.

300-PRINT-GRAND-TOTALS.

MOVE GRAND-TOTAL-THIS-YTD TO GTL-SALES-THIS-YTD.
MOVE GRAND-TOTAL-LAST-YTD TO GTL-SALES-LAST-YTD.
MOVE GRAND-TOTAL-LINE TO PRINT-AREA.
WRITE PRINT-AREA AFTER ADVANCING 2 LINES.


Attachment:- Assignment_COBOL.rar

Verified Expert

The program written in COBOL identifies the student id and individual marks in 4 subjects given in a .txt file. It then goes on to formulate the average obtained by each of the students and prints them. It also calculates the average marks obtained by the students in each of the subjects and prints them. The print chart attached will clarify the alignment and output format.

Reference no: EM13974571

Questions Cloud

What was the rate of return on this investment : Calculating the Number of Periods. Calculating Rates of Return. In 2011, an 1880-O Morgan silver dollar sold for $13,113. What was the rate of return on this investment?
What is the aftertax cash flow from the sale of this asset : Consider an asset that costs $730,000 and is depreciated straight-line to zero over its eight-year tax life. The asset is to be used in a five-year project; at the end of the project, the asset can be sold for $192,000. If the relevant tax rate is 40..
Road king trucks - assessment project : Road King Trucks - Assessment Project, The Transit Bus Opportunity. The company currently builds trucks and is considering building buses. A cost assessment should be done to see if the bus manufacturing will be at a reasonable cost.
How many houses of each type should domar build : Domar properties plc have a site covering 20,000m2 on which they wanted to build a mixed estate of 2- & 4-bedroom houses. The 2-bedroom houses will each occupy a plot of 60m2 and will be sold at a profit of $15,000. How many houses of each type shoul..
Cobol assignment : For this program you will use a file INFILE (listed here in numbers) that has information about students and their grades on 4 exams. The input file is shown below:
What would happen to interest rates and bond prices : One-year zero coupon treasury bonds are selling for £975.61 in the U.K. and for $963.86 in the U.S. Assume $1,000 face value in dollars for the U.S. bond and £1,000 face value for the U.K bond, and round interest rates to two decimal places, e.g. 2.5..
Sales under the percent-of-sales forecasting method : A firm has targeted a 40% growth in sales this year. Last year's cash as a percent of sales was 15%, accounts receivable 30%, and inventory 35%. What percentage growth in current assets is required to support the growth in sales under the percent-of-..
What depreciation will be shown in the income statement : An organisation buys a tangible non-current asset for £200,000. It has an estimated scrap value of £20,000 and an expected useful economic life of 10 years. What depreciation will be shown in the income statement for year 3? How would the non-current..
In us dollar exchange rate : Exxon Oil Corp. is negotiating the purchase of 1 million barrels of oil from a bankrupt competitor to be delivered and paid for in exactly 1 year. Exxon is willing to pay $106 per barrel because they can sell the oil in advance to oil refineries. For..

Reviews

Write a Review

COBOL Programming Questions & Answers

  A if you could pick a single source of cash for your

a. if you could pick a single source of cash for your business what would it be? why?nbspb. how can a business earn

  Calculate the size of monthly payment

Calculate the size of monthly payment necessary to repay a loan - Compute interest payment for each period and When computing the amortization table the program should report for the end of each year (12 month period) the total of payments, total of..

  Major difference between file and array

Major difference between file and array - how does record read from array and file

  Display a report of overall averages for each student

Your job is to display a report of the above information that includes overall averages for each student for exams 1 through 4, and class averages

  E easy to process in a cobol variable-length record

Which would be easy to process in a COBOL variable-length record or fixed-length record?

  Janice colangelo heads the training centre of the large hr

janice colangelo heads the training centre of the large hr consulting firm emt consulting. the firm has three major

  Prepare a cobol program

The purpose of this iLab assignment is to read data from a sequential file and produce a detail list of the records with simple formatted output (no headings and totals). In addition

  Review the description - flowchart and record layout

Review the description, flowchart, record layout, pseudocode, and hierarchy chart for the practice program. Review these items to gain a better understanding of the program's logic.

  Lenders bank program for cobol

Lenders bank program for cobol

  Print the number of personnel records processed

Compile and execute the program. If errors are reported, resolved them based on the messages reported by the compiler and by comparing the code.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd