QuestionQuestion

Interactive Taxi Energy Efficiency

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

Solution PreviewSolution Preview

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.
       PROGRAM-ID. YOUR-PROGRAM-NAME.

       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
          SELECT FLEETS
               ASSIGN TO 'LastnameFirstinitialA5.rpt'
               ORGANIZATION IS LINE SEQUENTIAL.

       DATA DIVISION.
       FILE SECTION.
       FD FLEETS.
       *> THE MAIN TABLE
       01 OUT-VEHICLE-REC.
          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
       01 FIRST-TITLE.
          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
       01 SECOND-LINE.
          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
       01 LAST-TITLE.
          05 SIZE-COL PIC X(15).
          05 MPG-COL PIC X(15).

       *> CALCULATED DATA
       01 BOTTOM-LINE.
          05 FLEETS-SIZE PIC X(15).
          05 FLEETS-MPG PIC X(15).

       WORKING-STORAGE SECTION.
       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.

$68.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats