Question: CS1123 C++ and Object Oriented Design Spring 2021 Homework Due 3-11 Write a program that reads in team names from a file then displays pairs

 CS1123 C++ and Object Oriented Design Spring 2021 Homework Due 3-11

CS1123 C++ and Object Oriented Design Spring 2021 Homework Due 3-11 Write a program that reads in team names from a file then displays pairs of teams. The teams should be displayed with the first paired with the last, the second paired with team n - 1, and so on. The purpose of this problem is to practice using vectors and iterators. While this problem can be solved in other ways, for this assignment, you are required to use both vectors and iterators. More specifically, your program should . Read in all team names from a file. (Most team names involve multiple words. The getline function may be useful.) Store the names in a vector. . If there is an odd number of teams, add "Automatic Win" to the end of the vector so that the first team will be paired with it. Display pairs of teams. For a list of n teams, display team 1 with n, team 2 with n-1, team 3 with n-2, and so on. A list of all hockey teams is provided in Moodle to use as the input. For this list, your code should display: Anaheim Ducks, Automatic Win Arizona Coyotes, Winnipeg Jets Boston Bruins, Washington Capitals Buffalo Sabres, Vancouver Golden Knights (This is a modified version of problem 3.20 on page 105.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!