The URNext Taxi Company has a fleet of taxis and they want to determine the energy efficiency of each taxi in the fleet as well as that of the entire fleet. Create an interactive COBOL program that accepts the fleet information from the user and generates a report file that indicates the miles per gallon for each taxi, as well as for the fleet as a whole. The program requirements are as follows:
1. The COBOL source file must be named as LastnameFirstinitialA5.cbl (e.g., BasilioEA5.cbl).
2. Include comments describing the purpose of the program and to provide the required class identifying information.
3. The PROGRAM-ID section of the IDENTIFICATION DIVISION must be written as LastnameFirstinitialA5 (e.g., BasilioEA5).
4. The ASSIGN TO section of the SELECT statement in the ENVIRONMENT DIVISION must be written as LastnameFirstinitialA5.rpt (e.g., BasilioEA5.rpt). This statement will cause the OUTPUT file (report) generated by the COBOL program to be named LastnameFirstinitialA5.rpt.
5. Use extended ACCEPT and DISPLAY statements or SCREEN SECTION to capture input from the user. Input consists of records with the following format:
a. Vehicle Identification (10 Alphanumeric characters)
b. Vehicle Description (10 Alphanumeric characters)
c. Miles traveled (4 Numeric digits) d. Number of gallons of gas used (4 Numeric digits with 2 decimals – 99V99)
6. Energy efficiency (i.e., miles per gallon) is calculated as miles traveled divided by the number of gallons of gas used. For example, if Taxi X traveled 200 miles and used 20 gallons of gas, then its energy efficiency or MPG equals 20 (200 / 20).
7. The expected report format is as follows:
a. Header with the company name and current date.
b. Record header i. Vehicle ID ii. Vehicle Desc
iii. Travel Miles iv. # of Gallons v. MPG
c. Data record for each vehicle entered (multiple lines expected)
d. Total header i. Fleet Size ii. Fleet MPG
e. Total data record for the fleet
8. The program shall continue accepting data from the user until the user indicates that there is no more data.
9. Create the Pseudocode for the program and save the file as LastnameFirstinitialA5.docx (e.g., BasilioEA5.docx) or LastnameFirstinitialA5.pdf (e.g., BasilioEA5.pdf).
10. Submit the COBOL source file, the report file, and the pseudocode
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.IDENTIFICATION DIVISION.
ASSIGN TO 'LastnameFirstinitialA5.rpt'
ORGANIZATION IS LINE SEQUENTIAL.
*> THE MAIN TABLE
05 VEHICLE-ID PIC X(15).
05 VEHICLE-DESC PIC X(15).
05 MILES PIC X(15).
05 GAS PIC X(15).
05 MPG PIC X(15).
*> TITLE AND DATE
05 FIRST-LINE PIC X(20).
05 MM PIC 9(2).
05 SS1 PIC X(1).
05 DD PIC 9(2).
05 SS2 PIC X(1).
05 YY PIC 9(4).
*> TABLE HEADER
05 HEAD-ID PIC X(15).
05 HEAD-DESC PIC X(15).
05 HEAD-MILES PIC X(15).
05 HEAD-GAS PIC X(15).
05 HEAD-MPG PIC X(15).
*> SUMMARY OF THE WORK
05 SIZE-COL PIC X(15).
05 MPG-COL PIC X(15).
*> CALCULATED DATA
05 FLEETS-SIZE PIC X(15).
05 FLEETS-MPG PIC X(15).
01 WS-ID PIC X(10).
01 WS-DESC PIC X(10).
01 WS-MILES-IN PIC X(4)....
By purchasing this solution you'll be able to access the following files:
Solution.docx and Solution.cbl.