Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BAGGINS Trucking maintains a trip file in which each record contains the following data: DRIVER name MILES driven on trip HOURS driven on trip Design

BAGGINS Trucking maintains a trip file in which each record contains the following data: DRIVER name MILES driven on trip HOURS driven on trip

Design an application that inputs records from the file (until reaching "eof") and, for each record, displays the DRIVER's name and the average Miles-per-Hours (MPH) for the trip where MPH is calculated by dividing the MILES by the HOURS. The program should also accumulate a GRAND total of the MILES driven. At the end, the program should display the GRAND total of the MILES driven.

For example, if the trip file contained the following: Smith, 300, 5 Williams, 750, 10 Jones, 880, 11

then the program should display: Smith averaged 60 mph Williams averaged 75 mph Jones averaged 80 mph Grand total of miles is 1,930

Pseudocode:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions