Details of this Paper

A fuel economy study was carried out for five models of cars

Description

solution


Question

A fuel economy study was carried out for five models of cars. Each car was driven 100 miles, and then the model of the car and the number of gallons used were placed in a line of the file Mileage.txt. Table 7.22 shows the data for the entries of the file. Write a program to display the models and their average mile per gallon in decreasing order with respect to mileage. See Figure 7.81 The program should utilize an array of structures with upper bound 4, where each structure has three members. The first member should record the name of each model of car. The second number should record the number of test vehicles for each model. The third member should record the total number of gallons used by that model.;[HINT: Two function procedures that are helpful have the headers "Function NumCars (make as string) as Integer and Function NumGals (make as string) as Double".] NumCars calculates the number of cars of the specific model in the table, and NumGals calculates the number of gallons used by the model. Both function procedures are easily coded with LINQ queries.

 

Paper#68813 | Written in 18-Jul-2015

Price : $37
SiteLock