Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Program A text file named superbowl.txt contains the year, winning score and losing score for 25 superbowl games. The data is organized in the

C++ Program

A text file named superbowl.txt contains the year, winning score and losing score for 25 superbowl games. The data is organized in the data file, as follows:

2005 24 21

1991 20 19

1967 35 10

2000 23 16

1968 33 14

1980 31 19

1969 16 7

1997 27 17

1970 23 7

Write a program that reads the data from the file into parallel arrays. Sort the arrays by year using the Selection Sort algorithm. Then, read a year from the user and use the Binary Search algorithm to find the winning and losing scores for that game. Print the year, winning score, and losing score for the user. If the year is not found print an appropriate message.

Your program must loop back to read another year, print the corresponding scores, etc. until the user enters an appropriate Sentinel value.

Your program must be modular, with separate functions to read the data file, sort the arrays in parallel, input a number from the user, search, and print results. Your output should be well-organized, neat, and easy to read.

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago

Question

Explain the concept of shear force and bending moment in beams.

Answered: 1 week ago