8.a) Consider the data below for Alaska Airlines and for American West Airlines. Construct a bar graph which breaks down the data by airline and by city, and which shows, for each airline, the percentage of on-time flights at each city.

b) Consider the data below for Alaska Airlines and for American West Airlines. Construct a bar graph which has only two bars. One bar should represent the percentage of on-time flights flown by Alaska Airlines (with all data from all cities used to calculate the percentage). The other bar should represent the percentage of on-time flights flown by American West (with all data from all cities used to calculate the percentage).

Data for Alaska Airlines:

On Time Delayed
Los Angeles 497 62
Phoenix 221 12
San Diego 212 20
San Francisco 503 102
Seattle 1841 305


Data for American West:

On Time Delayed
Los Angeles 694 117
Phoenix 4840 415
San Diego 383 65
San Francisco 320 129
Seattle 201 61

Cannot construct bar graph here.

For each airline, calculate total times, then total on time and total delayed. Divide latter two by total times to get %. Draw bars.

To construct the desired bar graphs, you will need to calculate the percentage of on-time flights for each airline in each city. Here's how you can do it:

a) Bar graph for each airline and city:

1. Calculate the percentage of on-time flights for Alaska Airlines:
- For Los Angeles: (497 / (497 + 62)) * 100 = 88.95%
- For Phoenix: (221 / (221 + 12)) * 100 = 94.87%
- For San Diego: (212 / (212 + 20)) * 100 = 91.40%
- For San Francisco: (503 / (503 + 102)) * 100 = 83.11%
- For Seattle: (1841 / (1841 + 305)) * 100 = 85.79%

2. Calculate the percentage of on-time flights for American West:
- For Los Angeles: (694 / (694 + 117)) * 100 = 85.57%
- For Phoenix: (4840 / (4840 + 415)) * 100 = 92.11%
- For San Diego: (383 / (383 + 65)) * 100 = 85.51%
- For San Francisco: (320 / (320 + 129)) * 100 = 71.27%
- For Seattle: (201 / (201 + 61)) * 100 = 76.70%

3. Construct a bar graph using these percentages, where the x-axis represents cities and the y-axis represents the percentage of on-time flights. Include two bars for each city, one for Alaska Airlines and one for American West Airlines.

b) Two-bar graph comparing the overall percentage of on-time flights for each airline:

1. Calculate the overall percentage of on-time flights for Alaska Airlines:
- Sum all the on-time flights for Alaska Airlines: 497 + 221 + 212 + 503 + 1841 = 3274
- Sum all the flights (on-time + delayed) for Alaska Airlines: 3274 + 62 + 12 + 20 + 102 + 305 = 3775
- Calculate the percentage: (3274 / 3775) * 100 = 86.73%

2. Calculate the overall percentage of on-time flights for American West:
- Sum all the on-time flights for American West: 694 + 4840 + 383 + 320 + 201 = 6438
- Sum all the flights (on-time + delayed) for American West: 6438 + 117 + 415 + 65 + 129 + 61 = 7325
- Calculate the percentage: (6438 / 7325) * 100 = 87.97%

3. Construct a bar graph with two bars, one representing the percentage of on-time flights for Alaska Airlines (86.73%) and the other representing the percentage of on-time flights for American West (87.97%).

Remember to label the axes, provide a clear title for the graph, and use different colors or patterns to distinguish between the two airlines.